home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utcsri!bonnie.concordia.ca!daily-planet.concordia.ca!alcor.Concordia.CA!gsa
- From: gsa@alcor.concordia.ca ( CON U GRADUATE STUDENTS' ASSOC )
- Newsgroups: comp.unix.shell
- Subject: Password protection for terminal via shell.
- Message-ID: <4734@daily-planet.concordia.ca>
- Date: 12 Aug 92 16:58:53 GMT
- References: <1992Aug3.165658.7658@novell.com> <FRIEDMAN.92Aug3194104@nutrimat.gnu.ai.mit.edu>
- Sender: usenet@daily-planet.concordia.ca
- Organization: Concordia University, Montreal, Quebec
- Lines: 26
-
- Someone sent me a shell script that is supposed to password
- protect your terminal, yet for some reason it doesn't seem
- to be working. Can someone tell me what's wrong with this?
-
- :
- #
- trap "echo Working on Process;stty echo;kill $$" 2 15
- SECRET="secret"
- stty -echo
- echo "Lock string: \c"
- read BUF1
- echo
- while :
- do
- BUF2= `line < /dev/tty`
- if [ "$BUF2" = "$BUF1" ]
- then break
- elif [ "$BUF2" = "$SECRET" ]
- then break
- fi
- echo "^G\c"
- done
- stty echo
-
- ---------
- Dan.
-