3 # Can be used to lock up a terminal screen until the user enters the correct
4 # password. Pretty sturdy. Store your password in the file "PASSWORD_FILE",
7 # Thanks to Kevin Wika for this shell.
9 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
18 PASSWORD_FILE=$TMP/lockem.password
19 LOG_FILE=$TMP/session-lockem.log
21 if [ ! -f "$PASSWORD_FILE" ]; then
23 echo "no password file is configured. please put your unlock password in:"
29 chmod 700 "$PASSWORD_FILE"
31 read password <"$PASSWORD_FILE"
33 echo "$(date_stringer): +++ terminal locked" >>"$LOG_FILE"
38 while [[ $attempt != $password ]]; do
39 if [ ! -z "$attempt" ]; then
40 echo "$(date_stringer): login attempt with wrong password at $(date)" >>$LOG_FILE
44 echo -ne "\npassword: "
49 echo "$(date_stringer): successful login" >>$LOG_FILE
50 echo "$(date_stringer): --- terminal unlocked" >>$LOG_FILE
53 echo "hi $USER, your password has been accepted. enjoy your computer."