[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] use dialog (when available) for shutdown/reboot message



Hi all,

I tested Debian Live with some of my students and they never seem to
notice the final "Please remove ..." message. They are sitting there
staring at the screen waiting for something else to happen. I fixed this
by using a dialog message. The results were much better.

Attached is a patch for live-initramfs.

Greetings

Ronny Standtke

-- 
Ronny Standtke                 Fachhochschule Nordwestschweiz
Dozent Medienpädagogik / ICT   Pädagogische Hochschule
Telefon: +41 32 627 92 47      Obere Sternengasse 7
Mobil  : +41 79 786 81 82      4502 Solothurn
diff --git a/debian/live-initramfs.init b/debian/live-initramfs.init
index 4cf767a..40587e7 100644
--- a/debian/live-initramfs.init
+++ b/debian/live-initramfs.init
@@ -154,19 +154,31 @@ do_stop ()
 
 			[ "$prompt" ] || return 0
 		fi
+		MESSAGE="${MESSAGE} and press ENTER to continue"
 
 		stty sane < /dev/console
 
-		echo -n -e "\n\n${MESSAGE} and press ENTER to continue:" > /dev/console
+		if [ -x /usr/bin/dialog ]
+		then
+			# TODO: set backtitle and ok-label to current action (reboot or shutdown)
+			dialog --nocancel --pause "${MESSAGE}." 11 40 30
+		else
+			echo -n -e "\n\n${MESSAGE}:" > /dev/console
+			READX="true"
+		fi
 
 		if [ -x /sbin/usplash_write ]
 		then
 			/sbin/usplash_write "TIMEOUT 86400"
 			/sbin/usplash_write "TEXT-URGENT ${MESSAGE}"
 			/sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
+			READX="true"
 		fi
 
-		read x < /dev/console
+		if [ -n "${READX}" ]
+		then
+			read x < /dev/console
+		fi
 	fi
 }
 

Reply to: