From 7d2ea7b79b915d55377c4c512f182f9d25899cd7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 4 Apr 2022 22:13:40 -0400 Subject: [PATCH] do some error detection --- pdt.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pdt.sh b/pdt.sh index c0ea98a..f6a3505 100644 --- a/pdt.sh +++ b/pdt.sh @@ -237,6 +237,17 @@ EOF read -r rbow -$account fi + for account in dbd fsf; do + if [[ ! -s $HOME/.rainbow_oauth-$account ]]; then + echo "pdt-setup error: expected non-empty file at $HOME/.rainbow_oauth-$account by this point. please fix and rerun pdt-setup or contact ian" + return 1 + fi + done + if diff -q $HOME/.rainbow_oauth-fsf $HOME/.rainbow_oauth-dbd &>/dev/null; then + echo "pdt-setup error: error, $HOME/.rainbow_oauth-fsf $HOME/.rainbow_oauth-dbd are the same. Did you follow the instructions closely and log into fsf and then dbd when prompted? try reruning pdt-setup and doing that" + return 1 + fi + if [[ ! -s ~/.gnusocial_login-$account ]]; then printf "$(tput setaf 5)█$(tput sgr0)%.0s" $(eval echo "{1..${COLUMNS:-60}}"); read -r -p "please enter the password for $account@status.fsf.org > " pass -- 2.25.1