summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmake-boot-image.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/make-boot-image.sh b/make-boot-image.sh
index b8654b9..8852256 100755
--- a/make-boot-image.sh
+++ b/make-boot-image.sh
@@ -365,13 +365,23 @@ echo_color() {
[ "x$4" == "xversion" ] && echo " (eficast v"$(cat /etc/eficast_version)")" || echo
}
-# if no args, print colored message, wait 10 sec and reboot
+# no args, print colored message, wait 10 sec and reboot
eficast_end() {
- ( sfx_success ; touch /run/nosound ) &
- message reboot "in 10s"
+ echo -e "\e]2;eficast_end\007" # Term title (tmux), intentionnal carriage return
echo_color white green "----- EFICAST end of execution ------"
- read -t10 -p 'Ctrl+C to have a shell, Enter to skip wait time...'
- reboot
+ ( sfx_success ; touch /run/nosound ) &
+ [ -r touch /run/eficast_end ] && action=$(cat /run/eficast_end)
+ case $action in
+ poweroff) read -t10 -p 'Ctrl+C to have a shell, Enter to skip wait time for poweroff...'
+ poweroff
+ ;;
+ reboot) read -t10 -p 'Ctrl+C to have a shell, Enter to skip wait time for reboot...'
+ reboot
+ ;;
+ *) echo "Dropping a shell (consider putting poweroff or reboot in /run/eficast_end)"
+ PS1='\h:\w# ' HOME='/root/' /bin/busybox sh
+ ;;
+ esac
}
# note : rcS rescue_shell is slighly different because most of the env is not ready in rcS