From 526aa984afc52d0d9231ce10e769a4079ac8458c Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Sat, 3 Jun 2023 17:06:12 -0700 Subject: [PATCH] updated source file --- .../Update_Sovran_SystemsOS.sh | 57 +++++++++++-------- .../Update_Sovran_SystemsOS.sh.archive | 47 +++++++++++++++ 2 files changed, 79 insertions(+), 25 deletions(-) create mode 100755 Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh.archive 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 5b85db5..ee81414 100755 --- a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh +++ b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -o nounset curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Intro.md" | zenity --text-info \ @@ -9,39 +10,45 @@ zenity --text-info \ if [[ $? -eq 1 ]]; then - exit 1 + exit 1 + +else + +ssh -i /home/free/.ssh/sovranpro_login root@192.168.1.32 '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 -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 \ +ssh -i /home/free/.ssh/sovranpro_login root@192.168.1.32 "nixos-rebuild switch --impure" | + zenity --progress \ --no-cancel \ --auto-close \ --pulsate \ --title="Sovran_SystemsOS Updater" - - zenity --info \ - --ellipsize \ - --no-wrap \ +if [[ $? != 0 ]]; then + echo "Could not Update Sovran_SystemsOS -- exiting" | + zenity --text-info \ --title="Sovran_SystemsOS Updater" \ - --text="Complete! Please Reboot." + --width=1110 \ + --height=710 + + exit 1 +fi - 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 new file mode 100755 index 0000000..5b85db5 --- /dev/null +++ b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh.archive @@ -0,0 +1,47 @@ +#!/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