Code: Select all
#!/bin/sh
### Prompts for Password; loops until correct
### Runs once, during startup. Run from /etc/profile.local
PASS="mypassword"
[ -f /tmp/passlock ] && exit
while [ ! "$x" = "$PASS" ]; do
echo "password:"
stty -echo # hide typing
read ans
x="$ans"
stty echo # turn back on
done
touch /tmp/passlock