rudimentary java library beginning. cleaned up scripts quite
[feisty_meow.git] / scripts / tty / lockup.sh
1 #!/bin/bash
2
3 # Thanks to Kevin Wika for this shell.
4
5 trap '' HUP
6 trap '' INT
7 trap '' QUIT
8 trap '' STOP
9 trap '' EXIT
10 trap '' TSTP
11
12 PASSWORDFILE=$TMP/lockup_password_file
13 LOGFILE=$TMP/lockup.log
14
15 read password <$PASSWORDFILE
16
17 echo "$(date_stringer): terminal locked" >>$LOGFILE
18
19 attempt=""
20
21 stty -echo
22 while [[ $attempt != $password ]]
23   do
24     if [ ! -z "$attempt" ]; then
25       echo "$(date_stringer): $attempt" >>$LOGFILE
26     fi
27     clear
28     echo -n "password: "
29     read attempt
30   done
31 stty echo
32
33 echo -e "$(date_stringer): successful login\n" >>$LOGFILE
34
35 clear
36 echo "Your Password has been Accepted."