From 18da758103e1fa374a8daa9e6e76f43bb1a00da6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 6 May 2007 15:52:53 +0200 Subject: [PATCH] grml-lock: provide quit option in welcome screen. --- debian/changelog | 6 ++++++ usr_bin/grml-lock | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5283a14..67fc7ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +grml-scripts (0.9.47) unstable; urgency=low + + * grml-lock: provide quit option in welcome screen. + + -- Michael Prokop Sun, 6 May 2007 15:52:36 +0200 + grml-scripts (0.9.46) unstable; urgency=low * grml-iptstate: check for '_conntrack' module instead of diff --git a/usr_bin/grml-lock b/usr_bin/grml-lock index e6e50e1..f3011e4 100755 --- a/usr_bin/grml-lock +++ b/usr_bin/grml-lock @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Son Mär 18 16:41:49 CET 2007 [mika] +# Latest change: Son Mai 06 15:52:16 CEST 2007 [mika] ################################################################################ PN=$0 @@ -21,7 +21,7 @@ it might not work as intended." 7 70 fi welcome_screen() { -dialog --stdout --title "$PN" --msgbox "Welcome to $PN! +dialog --stdout --title "$PN" --yes-label Continue --no-label Quit --yesno "Welcome to $PN! This script will lock virtual consoles when running on console or lock X server when running X. @@ -34,6 +34,13 @@ GNU screen)! Report bugs, send wishes and feedback to the grml team: http://www.grml.org/ - contact (at) grml.org " 16 65 + + case $? in + (0) # everything ok + ;; + (1) echo "Cancel pressed." ; exit 1 ;; + (255) echo "ESC pressed." ; exit 255 ;; + esac } lockcons() @@ -51,7 +58,7 @@ askxlock() dialog --stdout --title "$PN" --yesno "Now lock X?" 0 0 retval=$? case $retval in - 0) + 0) lockx ;; esac @@ -73,7 +80,7 @@ askpwd() dialog --stdout --title "$PN" --yesno "Set password for user $USER?" 0 0 retval=$? case $retval in - 0) + 0) while [ -z "$PASSWD" ] ; do PASSWD=$(dialog --stdout --title "$PN" --passwordbox "Set password (hidden typing):" 0 0) if [ -n "$PASSWD" ] ; then -- 2.1.4