Software/Sovran_SystemsOS_Updater/Updater Files/Update_Sovran_SystemsOS

47 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-05-22 19:32:08 -07:00
#!/usr/bin/env bash
2023-05-22 14:32:15 -07:00
password=$(zenity --password --title="Sovran_SystemsOS Updater")
if [ $? -eq 1 ] ; then
zenity --error \
2023-05-22 21:53:41 -07:00
--text="Update Canceled By User."
2023-05-22 14:32:15 -07:00
exit 1
else
2023-05-22 21:56:34 -07:00
zenity --info \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS Updater" \
--text="$( curl https://git.sovransystems.com/Sovran_Systems/Sovran_Systems_Packages/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Files/Info%20For%20Sovran_SystemsOS%20Updater.md)"
2023-05-22 14:32:15 -07:00
zenity --info \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS Updater" \
--text="$( echo -e "$password" | sudo -S rsync -av /home/free/Documents/Sovran\ Systems/My\ NixOS\ Laptop/configuration.nix /etc/nixos/configuration.nix)"
pushd /etc/nixos/
2023-05-22 21:53:41 -07:00
zenity --info \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS Updater" \
--text="$(echo -e $password | sudo -S nix flake update)"
2023-05-22 14:32:15 -07:00
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