-r|--run) echo "--run can't be used with other options!"; exit 1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
echo "Loading data..."
OWN_OUTPUT="$(./scripts/debug --run)"
append_dmesg () {
echo "${1}"
echo "dmesg"
echo "-----"
dmesg
}
if [[ $allow_colors = false ]]; then
OWN_OUTPUT=$(echo "${OWN_OUTPUT}" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g")
fi
if [[ $filter_sensitive = true ]]; then
# TODO: Add more filters
OWN_OUTPUT=$(echo "${OWN_OUTPUT}" | sed '/onion/d')
fi
if [[ $dmesg = true ]]; then
OWN_OUTPUT=$(append_dmesg "${OWN_OUTPUT}")
fi
echo "${OWN_OUTPUT}"
if [[ $upload = true ]]; then
if [[ $dmesg = false ]]; then
OWN_OUTPUT=$(append_dmesg "${OWN_OUTPUT}")
fi
OWN_OUTPUT=$(echo "${OWN_OUTPUT}" | sed '/onion/d')
fi
echo "================"
echo "==== Result ===="
echo "================"
echo
if [[ ! -z "${BITCOIN_NODE_OS:-}" ]]; then
if [[ $(vcgencmd get_throttled) != "throttled=0x0" ]]; then
if [[ $(vcgencmd get_throttled) = "throttled=0x5"* ]]; then
echo "There is probably issue with your power supply. We recommend using the official power supply to avoid this issue."
else
echo "The temperature of your Raspberry Pi is too high. We recommend either using a case that lowers the temperature of your Pi or a case with a builtin fan."
fi
exit 0
fi
no_of_block_devices=$(list_block_devices | wc -l)
if [[ $no_of_block_devices -lt 1 ]]; then
echo "You have either no external drive connected to your Raspberry Pi or the drive is not being detected."
echo "Please shutdown your Raspberry Pi ('sudo shutdown'), then plug the SSD into the other USB3 port."
echo "After you've finished that, boot your Raspberry Pi back up. If it still still doesn't work,"
echo "you can contact us on Telegram."
if [[ $upload = true ]]; then
echo "To make it possible for us to analyze your problem easier, please share the following link with us:"
echo "${OWN_OUTPUT}" | upload
elif [[ $instructions = true ]]; then
echo "Please run this script again with the --upload flag to generate a link to share."
fi
exit 0
elif [[ $no_of_block_devices -gt 1 ]]; then
echo "You have multiple external drives connected to your Raspberry Pi. Please remove the drive(s) you don't want to use for Citadel,"
echo "then reboot your Raspberry Pi by running 'sudo reboot'."
exit 0
fi
fi
echo "The debug script did not automatically detect any issues with your Citadel."
if [[ $upload = true ]]; then
echo "Please copy the following link and share it with us on Telegram so we can help you with your problem."
if [[ $tor = true ]]; then
echo "${OWN_OUTPUT}" | torupload
else
echo "${OWN_OUTPUT}" | upload
fi
elif [[ $instructions = true ]]; then
echo "Please copy the entire output of this script and share it with us on Telegram so we can help you with your problem."
echo "It's recommended to upload the output somewhere and share a link to it. Run this script with '--upload' to automatically generate a link to share."