updated updater script removed root script

This commit is contained in:
naturallaw77 2023-06-18 09:10:14 -07:00
parent 15dd683d0f
commit b47280923d
3 changed files with 59 additions and 109 deletions

View File

@ -1,11 +1,66 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cd /home/free/Downloads set -o nounset
wget "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Update_Sovran_SystemsOS_Root.sh" ID=$(curl ifconfig.me)
bash /home/free/Downloads/Update_Sovran_SystemsOS_Root.sh | zenity --progress --no-cancel --pulsate --auto-close --width=500 --title="Sovran_SystemsOS_Updater" --text="Update In Progress" curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Intro.md" |
rm -rf /home/free/Downloads/Update_Sovran_SystemsOS_Root.sh zenity --text-info \
--title="Sovran_SystemsOS Updater" \
--width=1000 \
--height=700
if [[ $? -eq 1 ]]; then
exit 1
else
#id=$(curl ifconfig.me)
ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'cd /etc/nixos; nix flake update'
if [[ $? != 0 ]]; then
echo "Could not update flake -- exiting" |
zenity --text-info \
--title="Sovran_SystemsOS Updater" \
--width=1110 \
--height=710
exit 1
fi
ssh -i /home/free/.ssh/sovranpro_login root@${ID} "nixos-rebuild switch --impure" |
zenity --progress \
--no-cancel \
--auto-close \
--pulsate \
--title="Sovran_SystemsOS Updater"
if [[ $? != 0 ]]; then
echo "Could not Update Sovran_SystemsOS -- exiting" |
zenity --text-info \
--title="Sovran_SystemsOS Updater" \
--width=1110 \
--height=710
exit 1
fi
zenity --info \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS Updater" \
--text="Complete! Please Reboot."
fi
exit 0 exit 0

View File

@ -1,47 +0,0 @@
#!/usr/bin/env bash
curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Intro.md" |
zenity --text-info \
--title="Sovran_SystemsOS Updater" \
--width=1110 \
--height=710
if [[ $? -eq 1 ]]; then
exit 1
fi
password=$(zenity --password --title="Sovran_SystemsOS Updater")
if [ $? -eq 1 ] ; then
exit 2
else
pushd /etc/nixos/
echo -e "$password" | sudo -S nix flake update
popd
echo -e "$password" | sudo -S nixos-rebuild switch --impure |
zenity --progress \
--no-cancel \
--auto-close \
--pulsate \
--title="Sovran_SystemsOS Updater"
zenity --info \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS Updater" \
--text="Complete! Please Reboot."
fi
exit 0

View File

@ -1,58 +0,0 @@
#!/usr/bin/env bash
set -o nounset
ID=$(curl ifconfig.me)
curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Intro.md" |
zenity --text-info \
--title="Sovran_SystemsOS Updater" \
--width=1110 \
--height=710
if [[ $? -eq 1 ]]; then
exit 1
else
#id=$(curl ifconfig.me)
ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'cd /etc/nixos; nix flake update'
if [[ $? != 0 ]]; then
echo "Could not update flake -- exiting" |
zenity --text-info \
--title="Sovran_SystemsOS Updater" \
--width=1110 \
--height=710
exit 1
fi
ssh -i /home/free/.ssh/sovranpro_login root@${ID} "nixos-rebuild switch --impure" |
zenity --progress \
--no-cancel \
--auto-close \
--pulsate \
--title="Sovran_SystemsOS Updater"
if [[ $? != 0 ]]; then
echo "Could not Update Sovran_SystemsOS -- exiting" |
zenity --text-info \
--title="Sovran_SystemsOS Updater" \
--width=1110 \
--height=710
exit 1
fi
zenity --info \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS Updater" \
--text="Complete! Please Reboot."
fi
exit 0