updated master script and removed script root

This commit is contained in:
naturallaw77 2023-06-17 14:42:46 -07:00
parent 954794cf25
commit 3dd1d43bab

View File

@ -100,7 +100,7 @@ FILE=$(/var/lib/beacons/reseter/completed)
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS_Reseter" \
--text="Could Not Factory Keys"
--text="Could Not Remove Factory Keys"
exit 1
fi
@ -108,17 +108,32 @@ fi
#### BEGIN SCRIPT ####
zenity --progress --no-cancel --pulsate --auto-close --width=700 --title="Sovran_SystemsOS_Reseter" --text="Please Wait. Passwords Are Being Reset. This May Take Some Time..." &
if [[ $? != 0 ]]; then
zenity --error \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS_Reseter" \
--text="Could Not Start Reset of Passwords"
exit 1
else
#### Reset Keys for Agenix ####
# Make Backup Directory
while [zenity --progress --no-cancel --pulsate --auto-close --width=700 --title="Sovran_SystemsOS_Reseter" --text="Please Wait. Passwords Are Being Reset. This May Take Some Time...";]
do
#### RESET KEYS FOR AGENIX ####
### Make Backup Directory ####
NOW=$(date '+%Y%m%d.%H%M%S') # default NOW string
BAKDIR=bak_${NOW}
@ -138,7 +153,7 @@ fi
# Move existing keys to Backup Directory
#### Move existing keys to Backup Directory ####
ssh -i /home/free/.ssh/sovranpro_login root@${ID} "cd /root/.ssh/agenix/; mv agenix-secret-keys* ${BAKDIR}"
@ -155,7 +170,7 @@ fi
# Generate New Keys
##### Generate New Keys ####
ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'ssh-keygen -q -N "" -t ed25519 -f /root/.ssh/agenix/agenix-secret-keys'
@ -173,7 +188,7 @@ fi
# Send .pub into agenix/secrets.nix
#### Send .pub into agenix/secrets.nix ####
ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'sed -i -e "0,/root.*/{s::root = $(cat /root/.ssh/agenix/agenix-secret-keys.pub):};s:root@nixos::" /var/lib/agenix-secrets/secrets.nix'
@ -525,7 +540,6 @@ zenity --error \
exit 1
fi
done
#### FINAL DIALOG POPUP ####
@ -545,15 +559,19 @@ rm -rf /home/free/.Sovran_Systems/Icon_Reseter
rm -rf /home/free/.local/share/applications/Sovran_SystemsOS_Reseter.desktop
if [[ $? != 0 ]]; then
if [[ $? != 0 ]]; then
zenity --error \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS_Reseter" \
--text="Could Not Remove Reseter App"
zenity --error \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS_Reseter" \
--text="Could Not Remove Reseter App"
exit 1
fi
fi
exit 1
fi
exit 0