3 # Purpose: lock console
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 # Latest change: Son Mär 18 16:41:49 CET 2007 [mika]
8 ################################################################################
12 if [ -r /etc/grml/script-functions ] ; then
13 . /etc/grml/script-functions
14 check4progs vlock xlock sudo chpasswd dialog || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 }
17 if [ -r /etc/grml_version ] ; then
19 dialog --stdout --title "$PN" --msgbox "Warning: this system does not look like a grml-system
20 it might not work as intended." 7 70
24 dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
26 This script will lock virtual consoles when running
27 on console or lock X server when running X.
29 Notice that you can not lock a GNU screen-session
30 via this script, use the lockscreen command
31 instead (default is pressing ctrl-a x inside
34 Report bugs, send wishes and feedback to the grml team:
35 http://www.grml.org/ - contact (at) grml.org
51 dialog --stdout --title "$PN" --yesno "Now lock X?" 0 0
62 dialog --stdout --title "$PN" --yesno "Now lock consoles?" 0 0
73 dialog --stdout --title "$PN" --yesno "Set password for user $USER?" 0 0
77 while [ -z "$PASSWD" ] ; do
78 PASSWD=$(dialog --stdout --title "$PN" --passwordbox "Set password (hidden typing):" 0 0)
79 if [ -n "$PASSWD" ] ; then
80 echo "$USER:$PASSWD" | sudo chpasswd
82 dialog --stdout --title "$PN" --msgbox "Error while setting password. Empty passwords are not accepted." 6 65
92 if [[ $(tty) == /dev/tty* ]] ; then
96 elif [ -n "$DISPLAY" ] ; then
102 ## END OF FILE #################################################################