projects
/
grml-scripts-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grml-lock: provide quit option in welcome screen.
[grml-scripts-core.git]
/
usr_bin
/
grml-lock
diff --git
a/usr_bin/grml-lock
b/usr_bin/grml-lock
index
2d75050
..
f3011e4
100755
(executable)
--- a/
usr_bin/grml-lock
+++ b/
usr_bin/grml-lock
@@
-4,11
+4,16
@@
# 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.
# 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: S
am Mai 27 15:12:24 CEST 2006
[mika]
+# Latest change: S
on Mai 06 15:52:16 CEST 2007
[mika]
################################################################################
PN=$0
################################################################################
PN=$0
+if [ -r /etc/grml/script-functions ] ; then
+ . /etc/grml/script-functions
+ check4progs vlock xlock sudo chpasswd dialog || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 }
+fi
+
if [ -r /etc/grml_version ] ; then
else
dialog --stdout --title "$PN" --msgbox "Warning: this system does not look like a grml-system
if [ -r /etc/grml_version ] ; then
else
dialog --stdout --title "$PN" --msgbox "Warning: this system does not look like a grml-system
@@
-16,7
+21,7
@@
it might not work as intended." 7 70
fi
welcome_screen() {
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.
This script will lock virtual consoles when running
on console or lock X server when running X.
@@
-29,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
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()
}
lockcons()
@@
-46,7
+58,7
@@
askxlock()
dialog --stdout --title "$PN" --yesno "Now lock X?" 0 0
retval=$?
case $retval in
dialog --stdout --title "$PN" --yesno "Now lock X?" 0 0
retval=$?
case $retval in
- 0)
+ 0)
lockx
;;
esac
lockx
;;
esac
@@
-68,7
+80,7
@@
askpwd()
dialog --stdout --title "$PN" --yesno "Set password for user $USER?" 0 0
retval=$?
case $retval in
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
while [ -z "$PASSWD" ] ; do
PASSWD=$(dialog --stdout --title "$PN" --passwordbox "Set password (hidden typing):" 0 0)
if [ -n "$PASSWD" ] ; then