trap 'stty sane; exit 1' 2
echo
echo "`firstname`, please choose a general password for your email, etc."
echo "This is not a login password.  You can set a login password later."
echo "The password you enter will not be echoed on your display."
echo
while true; do
	read -s -p 'Password: ' P1
	echo
	read -s -p '(again) : ' P2
	echo
	if [ "$P1" = "$P2" ]; then
		break
	fi
	echo
	echo 'There passwords you entered were not the same, please try again.'
	echo
done
F="$HOME/.password"
rm -f "$F"
touch "$F"
chmod 0600 "$F"
echo -n "$P1" > "$F"
chmod 0400 "$F"
echo
echo "Your password has been stored in the file $F"
echo 'You can change your password by running `setup_password`.'
echo
setup_password_hooks
exit 0
