Skip to content

Commit

Permalink
Reboot at the end of a fresh install (#1065)
Browse files Browse the repository at this point in the history
Fixes #1058

Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye authored Jul 30, 2020
1 parent 3d5e10d commit 8099d74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions build-image/first-boot.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -228,4 +227,6 @@ if running_in_docker; then
echo -e "$COL_DEF"
fi

reboot

# vim: filetype=sh
4 changes: 2 additions & 2 deletions build-image/webif.bash
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ if [ "$1" = "inst_done" ]; then
# shellcheck disable=SC2016
echo '<html>
<head>
<meta http-equiv='"refresh"' content='"10;url=http://${HOSTNAME:-$hostname}:8080/"' />
<meta http-equiv='"refresh"' content='"120;url=http://${HOSTNAME:-openhab}:8080/"' />
<title>openHABian</title>
</head>' > /tmp/webif/index.html
echo '<body>
<h1>openHABian Installation Status</h1>
Installation successful. You can now access the openHAB dashboard using <a href='"http://${HOSTNAME:-$hostname}:8080"'>this link</a>
Installation successful! The system will now reboot. After rebooting the openHAB dashboard will be available using <a href='"http://${HOSTNAME:-openhab}:8080"'>this link</a>
</body>
</html>' >> /tmp/webif/index.html
fi
Expand Down

0 comments on commit 8099d74

Please sign in to comment.