updated master script and removed script root
This commit is contained in:
parent
954794cf25
commit
3dd1d43bab
@ -100,7 +100,7 @@ FILE=$(/var/lib/beacons/reseter/completed)
|
|||||||
--ellipsize \
|
--ellipsize \
|
||||||
--no-wrap \
|
--no-wrap \
|
||||||
--title="Sovran_SystemsOS_Reseter" \
|
--title="Sovran_SystemsOS_Reseter" \
|
||||||
--text="Could Not Factory Keys"
|
--text="Could Not Remove Factory Keys"
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -108,17 +108,32 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### BEGIN SCRIPT ####
|
#### 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
|
NOW=$(date '+%Y%m%d.%H%M%S') # default NOW string
|
||||||
BAKDIR=bak_${NOW}
|
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}"
|
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'
|
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'
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
#### FINAL DIALOG POPUP ####
|
#### 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
|
rm -rf /home/free/.local/share/applications/Sovran_SystemsOS_Reseter.desktop
|
||||||
|
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
|
|
||||||
zenity --error \
|
zenity --error \
|
||||||
--ellipsize \
|
--ellipsize \
|
||||||
--no-wrap \
|
--no-wrap \
|
||||||
--title="Sovran_SystemsOS_Reseter" \
|
--title="Sovran_SystemsOS_Reseter" \
|
||||||
--text="Could Not Remove Reseter App"
|
--text="Could Not Remove Reseter App"
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
Loading…
Reference in New Issue
Block a user