From b47280923d0cff61c944371d22262979380b1e27 Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Sun, 18 Jun 2023 09:10:14 -0700 Subject: [PATCH] updated updater script removed root script --- .../Update_Sovran_SystemsOS.sh | 63 +++++++++++++++++-- .../Update_Sovran_SystemsOS.sh.archive | 47 -------------- .../Update_Sovran_SystemsOS_Root.sh | 58 ----------------- 3 files changed, 59 insertions(+), 109 deletions(-) delete mode 100755 Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh.archive delete mode 100755 Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS_Root.sh diff --git a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh index b46690c..af042dc 100755 --- a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh +++ b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh @@ -1,11 +1,66 @@ #!/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" | + + zenity --text-info \ + --title="Sovran_SystemsOS Updater" \ + --width=1000 \ + --height=700 -rm -rf /home/free/Downloads/Update_Sovran_SystemsOS_Root.sh + 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 \ No newline at end of file diff --git a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh.archive b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh.archive deleted file mode 100755 index 5b85db5..0000000 --- a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh.archive +++ /dev/null @@ -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 \ No newline at end of file diff --git a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS_Root.sh b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS_Root.sh deleted file mode 100755 index 6a42e81..0000000 --- a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS_Root.sh +++ /dev/null @@ -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 \ No newline at end of file