grml-lock: support fast execution on hd-install [Closes: issue220] 1.0.3
authorMichael Prokop <mika@grml.org>
Mon, 4 Jun 2007 20:50:26 +0000 (22:50 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 4 Jun 2007 20:50:26 +0000 (22:50 +0200)
debian/changelog
usr_bin/grml-lock

index 304622e..90b5382 100644 (file)
@@ -1,6 +1,7 @@
 grml-scripts (1.0.3) unstable; urgency=low
 
   * grml-lang: support dvorak keyboard layout
+  * grml-lock: support fast execution on hd-install [Closes: issue220]
 
  -- Michael Prokop <mika@grml.org>  Mon, 04 Jun 2007 22:33:36 +0200
 
index 82dca79..6b0bf59 100755 (executable)
@@ -4,17 +4,17 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Son Mai 06 15:52:16 CEST 2007 [mika]
+# Latest change: Mon Jun 04 22:49:37 CEST 2007 [mika]
 ################################################################################
 
-PN=$0
+PN="$0"
 
 if [ -r /etc/grml/script-functions ] ; then
    . /etc/grml/script-functions
    if [ -x /usr/bin/X ] ; then
-     check4progs vlock xlock sudo chpasswd dialog || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 }
+      check4progs vlock xlock sudo chpasswd dialog || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 }
    else
-     check4progs vlock sudo chpasswd dialog || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 }
+      check4progs vlock sudo chpasswd dialog || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 }
    fi
 fi
 
@@ -100,14 +100,18 @@ case $retval in
 esac
 }
 
-if [[ $(tty) == /dev/tty* ]] ; then
-  welcome_screen
-  askpwd
-  askvlock
-elif [ -n "$DISPLAY" ] ; then
-  welcome_screen
-  askpwd
-  askxlock
+if ! isgrmlcd ; then
+   [[ $(tty) == /dev/tty* ]] && lockcons || lockx
+else
+   if [[ $(tty) == /dev/tty* ]] ; then
+     welcome_screen
+     askpwd
+     askvlock
+   elif [ -n "$DISPLAY" ] ; then
+     welcome_screen
+     askpwd
+     askxlock
+   fi
 fi
 
 ## END OF FILE #################################################################