Ask google for "advanced bash". This is the best doc I know.
I also look often at startup scripts in /etc/init.d when I don't remember some constructs.
Code:
#!/bin/sh
cat << _EOF_
1) Restart
2) Shutdown
3) Logoff
_EOF_
while [ 1 ] ; do
echo -n "Enter choice and hit enter: "
read CHOICE
case "$CHOICE" in
1 )
echo "execute restart"
exit
;;
2 )
echo "execute shutdown"
exit
;;
3 )
echo "execute logoff"
exit
;;
esac
done