From 8099d7491dbb8658aa78b6c8a4aa76372de13faf Mon Sep 17 00:00:00 2001 From: Ethan Dye Date: Thu, 30 Jul 2020 14:48:19 -0600 Subject: [PATCH] Reboot at the end of a fresh install (#1065) Fixes #1058 Signed-off-by: Ethan Dye --- build-image/first-boot.bash | 9 +++++---- build-image/webif.bash | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build-image/first-boot.bash b/build-image/first-boot.bash index bdfff4dce..aa0e81e01 100755 --- a/build-image/first-boot.bash +++ b/build-image/first-boot.bash @@ -210,12 +210,11 @@ echo -n "$(timestamp) [openHABian] Waiting for openHAB to become ready on ${HOST # this took ~130 seconds on a RPi2 if ! tryUntil "curl --silent --head http://${HOSTNAME:-openhab}:8080/start/index |& grep -qs 'HTTP/1.1 200 OK'" 20 10; then echo "OK"; else echo "FAILED"; exit 1; fi -echo "$(timestamp) [openHABian] Visit the openHAB dashboard now: http://${HOSTNAME:-openhab}:8080" -echo "$(timestamp) [openHABian] To gain access to a console, simply reconnect." -echo "$(timestamp) [openHABian] First time setup successfully finished." +echo "$(timestamp) [openHABian] First time setup successfully finished. Rebooting your system!" +echo "$(timestamp) [openHABian] After rebooting the openHAB dashboard will be available at: http://${HOSTNAME:-openhab}:8080" +echo "$(timestamp) [openHABian] After rebooting to gain access to a console, simply reconnect using ssh." sleep 12 if [[ -x $(command -v python3) ]]; then bash /boot/webif.bash inst_done; fi -sleep 12 if running_in_docker; then PID="/var/lib/openhab2/tmp/karaf.pid" @@ -228,4 +227,6 @@ if running_in_docker; then echo -e "$COL_DEF" fi +reboot + # vim: filetype=sh diff --git a/build-image/webif.bash b/build-image/webif.bash index f43641729..574e7cc83 100644 --- a/build-image/webif.bash +++ b/build-image/webif.bash @@ -45,12 +45,12 @@ if [ "$1" = "inst_done" ]; then # shellcheck disable=SC2016 echo ' - + openHABian ' > /tmp/webif/index.html echo '

openHABian Installation Status

-Installation successful. You can now access the openHAB dashboard using this link +Installation successful! The system will now reboot. After rebooting the openHAB dashboard will be available using this link ' >> /tmp/webif/index.html fi