From 52657dc772145a5e9f5879df8def97ca81479100 Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Sun, 18 Jun 2023 08:56:11 -0700 Subject: [PATCH] updated updater script and added root script --- .../Update_Sovran_SystemsOS.sh | 51 ++-------------- .../Update_Sovran_SystemsOS_Root.sh | 58 +++++++++++++++++++ 2 files changed, 62 insertions(+), 47 deletions(-) create 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 6a42e81..6282a39 100755 --- a/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh +++ b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS.sh @@ -4,55 +4,12 @@ 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 +cd /home/free/Downloads -if [[ $? -eq 1 ]]; then - - exit 1 +wget "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Reseter/Reseter%20Source%20Files/Master_Passwords_Reset_Root.sh" -else +bash /home/free/Downloads/Master_Passwords_Reset.sh | zenity --progress --no-cancel --pulsate --auto-close --width=500 --title="Sovran_SystemsOS_Reseter" --text="Please Wait. Passwords Are Being Reset. This May Take Some Time..." -#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 +rm -rf /home/free/Downloads/Master_Passwords_Reset.sh 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 new file mode 100755 index 0000000..6a42e81 --- /dev/null +++ b/Sovran_SystemsOS_Updater/Updater Source Files/Update_Sovran_SystemsOS_Root.sh @@ -0,0 +1,58 @@ +#!/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