56 lines
1.1 KiB
Bash
Executable File
56 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -o nounset
|
|
|
|
curl "https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Intro.md" |
|
|
zenity --text-info \
|
|
--title="Sovran_SystemsOS Updater" \
|
|
--width=1110 \
|
|
--height=710
|
|
|
|
if [[ $? -eq 1 ]]; then
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
id=$(curl ifconfig.me || ifdata -pa enp2s0 || ifdata -pa wlp1s0)
|
|
|
|
ssh -i /home/free/.ssh/sovranpro_login root@${id} 'cd /etc/nixos; nix flake update'
|
|
|
|
if [[ $? != 0 ]]; then
|
|
echo "Could not update flake -- exiting" |
|
|
zenity --text-info \
|
|
--title="Sovran_SystemsOS Updater" \
|
|
--width=1110 \
|
|
--height=710
|
|
|
|
exit 1
|
|
fi
|
|
|
|
ssh -i /home/free/.ssh/sovranpro_login root@${id} "nixos-rebuild switch --impure" |
|
|
zenity --progress \
|
|
--no-cancel \
|
|
--auto-close \
|
|
--pulsate \
|
|
--title="Sovran_SystemsOS Updater"
|
|
|
|
if [[ $? != 0 ]]; then
|
|
echo "Could not Update Sovran_SystemsOS -- exiting" |
|
|
zenity --text-info \
|
|
--title="Sovran_SystemsOS Updater" \
|
|
--width=1110 \
|
|
--height=710
|
|
|
|
exit 1
|
|
fi
|
|
|
|
zenity --info \
|
|
--ellipsize \
|
|
--no-wrap \
|
|
--title="Sovran_SystemsOS Updater" \
|
|
--text="Complete! Please Reboot."
|
|
|
|
fi
|
|
|
|
exit 0 |