updated both updater scripts

This commit is contained in:
naturallaw77 2024-03-15 11:35:36 -07:00
parent b57ad193d2
commit 33900c09e2
2 changed files with 60 additions and 32 deletions

View File

@ -1,10 +1,11 @@
#!/usr/bin/env bash
FLATPAK () {
if ! ssh root@localhost 'flatpak update -y' ; then
zenity --error \
--title="Sovran_SystemsOS_Light Updater" \
--title="Sovran_SystemsOS_Light_Updater" \
--text="Could Not Update Flatpaks."
exit 1
@ -19,26 +20,37 @@ time_stamp=$(date +%Y-%m-%d-%T)
mkdir -p /home/free/Documents/Updater_App_Logs
if ! xterm -T "Sovran_SystemsOS_Light Updater" -fa 'Noto Mono' -fs 15 -fg white -bg black -e bash -c "ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch'" ; then
xterm -T "Sovran_SystemsOS_Light_Updater" -fa 'Noto Mono' -fs 15 -fg white -bg black -e bash -c "ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch 2>&1 | tee /home/free/Documents/Updater_App_Logs/{$time_stamp}_Updater_Log.txt'"
}
TACO () {
pushd /home/free/Documents/Updater_App_Logs
file=$(ls -Art | tail -n 1)
if grep -w "error" $file ; then
zenity --error \
--width=500 \
--title="Sovran_SystemsOS_Light Updater" \
--text="Could not complete the Sovran_SystemsOS_Light update."
exit 1
--width=1300 \
--title="Sovran_SystemsOS_Light_Updater" \
--text="Could not complete the Sovran_SystemsOS update. Check the error log in your Documents under Updater_App_Logs folder for more details."
else
zenity --info \
--ellipsize \
--no-wrap \
--width=500 \
--title="Sovran_SystemsOS_Light Updater" \
--width=600 \
--title="Sovran_SystemsOS_Light_Updater" \
--text="Yay complete! Please reboot when you are ready."
exit 1
fi
popd
}
#########
@ -47,8 +59,8 @@ curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovr
zenity --text-info \
--width=1000 \
--height=750 \
--title="Sovran_SystemsOS_Light Updater"
--height=850 \
--title="Sovran_SystemsOS_Light_Updater"
if [[ $? -eq 1 ]]; then
@ -56,12 +68,14 @@ if [[ $? -eq 1 ]]; then
else
FLATPAK | zenity --progress --no-cancel --auto-close --width=460 --pulsate --text="Updating Flatpaks now..." --title="Sovran_SystemsOS_Light Updater"
FLATPAK | zenity --progress --no-cancel --auto-close --width=460 --pulsate --text="Updating Flatpaks now..." --title="Sovran_SystemsOS_Light_Updater"
SPICE | zenity --progress --no-cancel --auto-close --width=750 --pulsate --text="Updating now. In rare cases, it could take up to 1 hour. Go have some herbal tea and relax while the update is in progress." --title="Sovran_SystemsOS_Light Updater"
SPICE | zenity --progress --no-cancel --auto-close --width=1050 --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_Light_Updater"
TACO
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 +3 -delete
fi
exit 0
exit 0

View File

@ -1,10 +1,11 @@
#!/usr/bin/env bash
FLATPAK () {
if ! ssh root@localhost 'flatpak update -y' ; then
zenity --error \
--title="Sovran_SystemsOS Updater" \
--title="Sovran_SystemsOS_Updater" \
--text="Could Not Update Flatpaks."
exit 1
@ -19,26 +20,37 @@ time_stamp=$(date +%Y-%m-%d-%T)
mkdir -p /home/free/Documents/Updater_App_Logs
if ! xterm -T "Sovran_SystemsOS Updater" -fa 'Noto Mono' -fs 15 -fg white -bg black -e bash -c "ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure'" ; then
xterm -T "Sovran_SystemsOS_Updater" -fa 'Noto Mono' -fs 15 -fg white -bg black -e bash -c "ssh root@localhost 'cd /etc/nixos && nix flake update && nixos-rebuild switch --impure 2>&1 | tee /home/free/Documents/Updater_App_Logs/{$time_stamp}_Updater_Log.txt'"
}
TACO () {
pushd /home/free/Documents/Updater_App_Logs
file=$(ls -Art | tail -n 1)
if grep -w "error" $file ; then
zenity --error \
--width=500 \
--title="Sovran_SystemsOS Updater" \
--text="Could not complete the Sovran_SystemsOS update."
exit 1
--width=1300 \
--title="Sovran_SystemsOS_Updater" \
--text="Could not complete the Sovran_SystemsOS update. Check the error log in your Documents under Updater_App_Logs folder for more details."
else
zenity --info \
--ellipsize \
--no-wrap \
--width=500 \
--title="Sovran_SystemsOS Updater" \
--width=600 \
--title="Sovran_SystemsOS_Updater" \
--text="Yay complete! Please reboot when you are ready."
exit 1
fi
popd
}
#########
@ -47,8 +59,8 @@ curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovr
zenity --text-info \
--width=1000 \
--height=750 \
--title="Sovran_SystemsOS Updater"
--height=850 \
--title="Sovran_SystemsOS_Updater"
if [[ $? -eq 1 ]]; then
@ -56,12 +68,14 @@ if [[ $? -eq 1 ]]; then
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"
SPICE | zenity --progress --no-cancel --auto-close --width=750 --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=1050 --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"
TACO
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 +3 -delete
fi
exit 0
exit 0