modules/clerie-system-upgrade: Always reboot after an update
This commit is contained in:
@@ -2,16 +2,11 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ALLOW_REBOOT=
|
||||
NO_CONFIRM=
|
||||
NODE_EXPORTER_METRICS_PATH=
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--allow-reboot)
|
||||
ALLOW_REBOOT=1
|
||||
shift
|
||||
;;
|
||||
--no-confirm)
|
||||
NO_CONFIRM=1
|
||||
shift
|
||||
@@ -63,13 +58,8 @@ ACTIVATING_SYSTEM_KERNEL="$(readlink /nix/var/nix/profiles/system/{initrd,kernel
|
||||
|
||||
if [[ "$BOOTED_SYSTEM_KERNEL" != "$ACTIVATING_SYSTEM_KERNEL" ]]; then
|
||||
echo "Reboot is required"
|
||||
if [[ -n "$ALLOW_REBOOT" ]]; then
|
||||
echo "Rebooting system now"
|
||||
shutdown -r +1 "System update requires reboot"
|
||||
else
|
||||
echo "Automatic reboot not allowed (maybe use --allow-reboot next time)"
|
||||
echo "The system upgrade is staged, please reboot manually soon"
|
||||
fi
|
||||
echo "Rebooting system now"
|
||||
shutdown -r +1 "System update requires reboot"
|
||||
else
|
||||
echo "No reboot is required"
|
||||
echo "Activating system now"
|
||||
|
Reference in New Issue
Block a user