home *** CD-ROM | disk | FTP | other *** search
/ The HTML Web Publisher's Construction Kit / HTMLWPCK.ISO / unix / cgi / 15_8.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-07-11  |  471 b   |  53 lines

  1. #!/bin/sh
  2.  
  3. #simple password script
  4.  
  5. PASSWORD=Schmoo
  6.  
  7. PROTECTEDFILE=/usr/me/securefile.html
  8.  
  9. if [ $# = 0 ]
  10.  
  11. then
  12.  
  13.     cat << EOM
  14.  
  15.         Content-Type: text/html
  16.  
  17.         <TITLE>Password script</TITLE>
  18.  
  19.         <ISINDEX>
  20.  
  21.         <H1>This page is protected. Enter password</H1>
  22.  
  23. EOM
  24.  
  25. elif [ "$#" = "$PASSWORD" ]
  26.  
  27. then
  28.  
  29.     echo Location: $PROTECTEDFILE
  30.  
  31.     echo
  32.  
  33. else
  34.  
  35.     cat << EOM2
  36.  
  37.         Content-Type: text/html
  38.  
  39.  
  40.  
  41.         <TITLE> FAIL!</TITLE>
  42.  
  43.         <ISINDEX>
  44.  
  45.         <H1>Password failed! Try again.</H1>
  46.  
  47. EOM2
  48.  
  49. fi  
  50.  
  51.  
  52.  
  53.