updated master script
This commit is contained in:
parent
90aec3594b
commit
69d19cf2a1
@ -20,33 +20,24 @@ if [[ $? -eq 1 ]]; then
|
||||
else
|
||||
|
||||
|
||||
#### Check to See If It Has Been Run Before ####
|
||||
|
||||
#### Initial Reseter Tag
|
||||
if [ ! -f /var/lib/beacons/reseter ]; then
|
||||
|
||||
ssh -i /home/free/.ssh/factory_login root@${ID} 'mkdir /var/lib/reseter ; touch /var/lib/reseter/started'
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
zenity --error \
|
||||
--ellipsize \
|
||||
--no-wrap \
|
||||
--title="Sovran_SystemsOS_Reseter" \
|
||||
--text="Could Not Start, Already Completed"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
PASS=$(zenity --password --title="Please Type In A New Sovran Pro Updater Password")
|
||||
|
||||
if [[ $? -eq 1 ]]; then
|
||||
zenity --error \
|
||||
--ellipsize \
|
||||
--no-wrap \
|
||||
--title="Sovran_SystemsOS_Reseter" \
|
||||
--text="Will Not Start, Already Completed"
|
||||
|
||||
exit 1
|
||||
|
||||
else
|
||||
|
||||
|
||||
ssh-keygen -q -N "${PASS}" -t ed25519 -f /home/free/.ssh/sovranpro_login
|
||||
#### Initial Reseter Tag ####
|
||||
|
||||
ssh -i /home/free/.ssh/factory_login root@${ID} 'mkdir /var/lib/beacons ; touch /var/lib/beacons/reseter/started'
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
@ -54,30 +45,54 @@ ssh-keygen -q -N "${PASS}" -t ed25519 -f /home/free/.ssh/sovranpro_login
|
||||
--ellipsize \
|
||||
--no-wrap \
|
||||
--title="Sovran_SystemsOS_Reseter" \
|
||||
--text="Could Not Create New Login Key"
|
||||
--text="Could Not Create Reseter Tag"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#### Create New Log In Key For the Local Sovran Pro ####
|
||||
|
||||
ssh -i /home/free/.ssh/factory_login root@${ID} 'sed -i -e "0,/ssh-ed25519.*/{ s::$(cat /home/free/.ssh/sovranpro_login.pub): }" /root/.ssh/authorized_keys'
|
||||
PASS=$(zenity --password --title="Please Type In A New Sovran Pro Updater Password")
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
zenity --error \
|
||||
--ellipsize \
|
||||
--no-wrap \
|
||||
--title="Sovran_SystemsOS_Reseter" \
|
||||
--text="Could Not Move Key to Root"
|
||||
if [[ $? -eq 1 ]]; then
|
||||
|
||||
exit 1
|
||||
|
||||
else
|
||||
|
||||
|
||||
ssh-keygen -q -N "${PASS}" -t ed25519 -f /home/free/.ssh/sovranpro_login
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
zenity --error \
|
||||
--ellipsize \
|
||||
--no-wrap \
|
||||
--title="Sovran_SystemsOS_Reseter" \
|
||||
--text="Could Not Create New Login Key"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
ssh -i /home/free/.ssh/factory_login root@${ID} 'sed -i -e "0,/ssh-ed25519.*/{ s::$(cat /home/free/.ssh/sovranpro_login.pub): }" /root/.ssh/authorized_keys'
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
zenity --error \
|
||||
--ellipsize \
|
||||
--no-wrap \
|
||||
--title="Sovran_SystemsOS_Reseter" \
|
||||
--text="Could Not Move Key to Root"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
rm -rf /home/free/.ssh/factory_login /home/free/.ssh/factory_login.pub
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
zenity --error \
|
||||
--ellipsize \
|
||||
@ -85,8 +100,8 @@ ssh -i /home/free/.ssh/factory_login root@${ID} 'sed -i -e "0,/ssh-ed25519.*/{ s
|
||||
--title="Sovran_SystemsOS_Reseter" \
|
||||
--text="Could Not Factory Keys"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@ -463,7 +478,7 @@ fi
|
||||
|
||||
#### FINAL RESETER TAG ####
|
||||
|
||||
ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'touch /var/lib/reseter/completed'
|
||||
ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'touch /var/lib/beacons/reseter/completed'
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user