Software/Sovran_SystemsOS_Updater/Updater Files/Update_Sovran_SystemsOS

58 lines
1.0 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
2023-05-22 22:23:31 -07:00
zenity --text-info \
--filename="$(curl )" \
--title="Sovran_SystemsOS Updater" \
--width=850 \
--height=730 \
--auto-scroll
if [[ $? -eq 1 ]]; then
zenity --info \
--title="Sovran_SystemsOS Updater" \
--text="Update Canceled By User"
exit 1
fi
2023-05-22 22:23:31 -07:00
2023-05-22 14:32:15 -07:00
password=$(zenity --password --title="Sovran_SystemsOS Updater")
if [ $? -eq 1 ] ; then
zenity --info \
--title="Sovran_SystemsOS Updater" \
--text="Update Canceled By User"
2023-05-22 14:32:15 -07:00
exit 2
2023-05-22 14:32:15 -07:00
else
2023-05-22 21:56:34 -07:00
echo -e "$password" | sudo -S rsync -av /home/free/Documents/Sovran\ Systems/My\ NixOS\ Laptop/configuration.nix /etc/nixos/configuration.nix
2023-05-22 14:32:15 -07:00
pushd /etc/nixos/
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"
2023-05-22 14:32:15 -07:00
2023-05-22 14:32:15 -07:00
zenity --info \
--ellipsize \
--no-wrap \
--title="Sovran_SystemsOS Updater" \
--text="Complete! Please Reboot."
fi
exit 0