Software/Sovran_SystemsOS_Updater/Updater Files/Update_Sovran_SystemsOS
2023-05-23 09:56:54 -07:00

59 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
link=$(curl https://git.sovransystems.com/Sovran_Systems/Sovran_Systems_Packages/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Files/Intro_Info)
zenity --text-info \
--filename="$link" \
--title="Sovran_SystemsOS Updater" \
--width=850 \
--height=730 \
if [[ $? -eq 1 ]]; then
zenity --info \
--title="Sovran_SystemsOS Updater" \
--text="Update Canceled By User"
exit 1
fi
password=$(zenity --password --title="Sovran_SystemsOS Updater")
if [ $? -eq 1 ] ; then
zenity --info \
--title="Sovran_SystemsOS Updater" \
--text="Update Canceled By User"
exit 2
else
echo -e "$password" | sudo -S rsync -av /home/free/Documents/Sovran\ Systems/My\ NixOS\ Laptop/configuration.nix /etc/nixos/configuration.nix
pushd /etc/nixos/
echo -e "$password" | sudo -S nix flake update
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