update updater script

This commit is contained in:
naturallaw77 2024-03-13 20:40:08 -07:00
parent 7984ab7b17
commit fb497df56c

View File

@ -14,7 +14,7 @@ fi
} }
CASHU () { SPICE () {
if ! ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure &> /home/free/Documents/Updater_App_Logs/'$time_stamp'_Updater_Log.txt' ; then if ! ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure &> /home/free/Documents/Updater_App_Logs/'$time_stamp'_Updater_Log.txt' ; then
@ -27,46 +27,8 @@ if ! ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild swit
else else
exit 1
fi if ! ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure &> /home/free/Documents/Updater_App_Logs/'$time_stamp'_Updater_Log.txt' ; then
}
SPICE () {
time_stamp=$(date +%Y-%m-%d-%T)
mkdir -p /home/free/Documents/Updater_App_Logs
if ! ssh root@localhost 'cd /etc/nixos && nix flake update' ; then
zenity --error \
--width=400 \
--title="Sovran_SystemsOS Updater" \
--text="Could not complete the Sovran_SystemsOS flake update."
exit 1
fi
if ! ssh root@localhost 'nixos-rebuild dry-activate --impure' ; then
zenity --error \
--width=400 \
--title="Sovran_SystemsOS Updater" \
--text="Could not complete the test Sovran_SystemsOS update."
exit 1
fi
if ! ssh root@localhost 'nixos-rebuild switch --impure &> /home/free/Documents/Updater_App_Logs/'$time_stamp'_Updater_Log.txt' ; then
zenity --error \ zenity --error \
--width=400 \ --width=400 \
@ -86,8 +48,11 @@ else
fi fi
fi
} }
######### #########
curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Intro.md" | curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Intro.md" |
@ -105,8 +70,6 @@ else
FLATPAK | zenity --progress --no-cancel --auto-close --width=460 --pulsate --text="Updating Flatpaks now..." --title="Sovran_SystemsOS Updater" FLATPAK | zenity --progress --no-cancel --auto-close --width=460 --pulsate --text="Updating Flatpaks now..." --title="Sovran_SystemsOS Updater"
CASHU
SPICE | zenity --progress --no-cancel --auto-close --width=850 --pulsate --text="Updating now. In rare cases, it could take up to 3 hours. Go have some herbal tea and relax while the update is in progress." --title="Sovran_SystemsOS Updater" SPICE | zenity --progress --no-cancel --auto-close --width=850 --pulsate --text="Updating now. In rare cases, it could take up to 3 hours. Go have some herbal tea and relax while the update is in progress." --title="Sovran_SystemsOS Updater"
find /home/free/Documents/Updater_App_Logs -name "*.txt" -type f -mtime +5 -delete find /home/free/Documents/Updater_App_Logs -name "*.txt" -type f -mtime +5 -delete