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: Sam Mai 27 15:12:24 CEST 2006 [mika]
8 ################################################################################
12 if [ -r /etc/grml_version ] ; then
14 dialog --stdout --title "$PN" --msgbox "Warning: this system does not look like a grml-system
15 it might not work as intended." 7 70
19 dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
21 This script will lock virtual consoles when running
22 on console or lock X server when running X.
24 Notice that you can not lock a GNU screen-session
25 via this script, use the lockscreen command
26 instead (default is pressing ctrl-a x inside
29 Report bugs, send wishes and feedback to the grml team:
30 http://www.grml.org/ - contact (at) grml.org
46 dialog --stdout --title "$PN" --yesno "Now lock X?" 0 0
57 dialog --stdout --title "$PN" --yesno "Now lock consoles?" 0 0
68 dialog --stdout --title "$PN" --yesno "Set password for user $USER?" 0 0
72 while [ -z "$PASSWD" ] ; do
73 PASSWD=$(dialog --stdout --title "$PN" --passwordbox "Set password (hidden typing):" 0 0)
74 if [ -n "$PASSWD" ] ; then
75 echo "$USER:$PASSWD" | sudo chpasswd
77 dialog --stdout --title "$PN" --msgbox "Error while setting password. Empty passwords are not accepted." 6 65
87 if [[ $(tty) == /dev/tty* ]] ; then
91 elif [ -n "$DISPLAY" ] ; then
97 ## END OF FILE #################################################################