From 035ebd359240a6471c0d7da155231e6e32c32dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85skar=20Andersson?= Date: Sat, 11 Nov 2017 22:33:13 +0100 Subject: [PATCH] Allow reboot from script --- package/opt/hassbian/suites/upgrade_hassbian.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/package/opt/hassbian/suites/upgrade_hassbian.sh b/package/opt/hassbian/suites/upgrade_hassbian.sh index a41cd043..daa1642e 100755 --- a/package/opt/hassbian/suites/upgrade_hassbian.sh +++ b/package/opt/hassbian/suites/upgrade_hassbian.sh @@ -1,6 +1,6 @@ #!/bin/bash function hassbian-show-short-info { - echo "Upgrade the base OS installation on this system" + echo "Home Assistant upgrade script for Hassbian" } function hassbian-show-long-info { @@ -25,11 +25,16 @@ sudo apt upgrade -y echo echo "Uppgrade complete." echo -echo "Note that you may need to reboot the raspberry Pi for some updates to take effect." -echo echo "If you have issues with this script, please say something in the #Hassbian channel on Discord." echo -return 0 +echo "Note that you may need to reboot the raspberry Pi for some updates to take effect." +echo +read -p "Would you like to reboot your raspberry Pi now? (y/n)?" choice +case "$choice" in + y|Y ) sudo reboot;; + n|N ) echo;; + * ) echo "invalid";; +esac } # Make this script function as it always has if run standalone, rather than issue a warning and do nothing.