projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git]
/
scripts
/
tty
/
lockem.sh
diff --git
a/scripts/tty/lockem.sh
b/scripts/tty/lockem.sh
index 473e086769529dbdf8d03271b5f628d8d2cbecde..fb781b144d6c4084397a3460c0998164a80f1f08 100644
(file)
--- a/
scripts/tty/lockem.sh
+++ b/
scripts/tty/lockem.sh
@@
-1,7
+1,7
@@
#!/bin/bash
# Can be used to lock up a terminal screen until the user enters the correct
#!/bin/bash
# Can be used to lock up a terminal screen until the user enters the correct
-# password. Pretty sturdy. Store your password in the file "PASSWORDFILE",
+# password. Pretty sturdy. Store your password in the file "PASSWORD
_
FILE",
# configured below.
#
# Thanks to Kevin Wika for this shell.
# configured below.
#
# Thanks to Kevin Wika for this shell.
@@
-15,27
+15,29
@@
trap '' STOP
trap '' EXIT
trap '' TSTP
trap '' EXIT
trap '' TSTP
-PASSWORD
FILE=$TMP/lockup_password_file
-LOG
FILE=$TMP/session-lockup
.log
+PASSWORD
_FILE=$TMP/lockem.password
+LOG
_FILE=$TMP/session-lockem
.log
-if [ ! -f "$PASSWORDFILE" ]; then
+if [ ! -f "$PASSWORD
_
FILE" ]; then
sep
echo "no password file is configured. please put your unlock password in:"
sep
echo "no password file is configured. please put your unlock password in:"
- echo "$PASSWORDFILE"
+ echo "$PASSWORD
_
FILE"
sep
exit 1
fi
sep
exit 1
fi
-read password <$PASSWORDFILE
+chmod 700 "$PASSWORD_FILE"
-echo "$(date_stringer): +++ terminal locked" >>$LOGFILE
+read password <"$PASSWORD_FILE"
+
+echo "$(date_stringer): +++ terminal locked" >>"$LOG_FILE"
attempt=""
stty -echo
while [[ $attempt != $password ]]; do
if [ ! -z "$attempt" ]; then
attempt=""
stty -echo
while [[ $attempt != $password ]]; do
if [ ! -z "$attempt" ]; then
- echo "$(date_stringer): login attempt with wrong password at $(date)" >>$LOGFILE
+ echo "$(date_stringer): login attempt with wrong password at $(date)" >>$LOG
_
FILE
fi
clear
nechung
fi
clear
nechung
@@
-44,8
+46,8
@@
while [[ $attempt != $password ]]; do
done
stty echo
done
stty echo
-echo "$(date_stringer): successful login" >>$LOGFILE
-echo "$(date_stringer): --- terminal unlocked" >>$LOGFILE
+echo "$(date_stringer): successful login" >>$LOG
_
FILE
+echo "$(date_stringer): --- terminal unlocked" >>$LOG
_
FILE
clear
echo "hi $USER, your password has been accepted. enjoy your computer."
clear
echo "hi $USER, your password has been accepted. enjoy your computer."