From 3dd1d43bab4054ff741d9fa027cbbf93797c125e Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Sat, 17 Jun 2023 14:42:46 -0700 Subject: [PATCH] updated master script and removed script root --- .../Master_Passwords_Reset.sh | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh b/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh index bafe3e5..6e27dd5 100644 --- a/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh +++ b/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh @@ -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 \ No newline at end of file