chore(tools): prompt user to reboot when running interactively after updates
This commit is contained in:
@@ -130,4 +130,19 @@ if [ -f /var/run/reboot-required ]; then
|
|||||||
echo -e "${GRAY}Packages requiring reboot:${NC}"
|
echo -e "${GRAY}Packages requiring reboot:${NC}"
|
||||||
sed 's/^/ • /' /var/run/reboot-required.pkgs
|
sed 's/^/ • /' /var/run/reboot-required.pkgs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -t 0 ]; then
|
||||||
|
echo ""
|
||||||
|
echo -e -n "${BOLD}Reboot now? [y/N]: ${NC}"
|
||||||
|
read -r reboot_reply
|
||||||
|
case "$reboot_reply" in
|
||||||
|
[yY]|[yY][eE][sS])
|
||||||
|
info "Rebooting..."
|
||||||
|
systemctl reboot
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
info "Reboot skipped. Remember to reboot later."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user