$!----------------------------------------------------------------------------+ $! WWWSETUP - Set up directory and protections for personal home pages ! $!----------------------------------------------------------------------------+ $ SAVERIFY = 'F$VERIFY(0)' ! Save and turn off verify $ SAY = "WRITE SYS$OUTPUT" ! Shortcut for messages $ CURDIR = F$ENVIRONMENT("DEFAULT") ! Current directory $ ON ERROR THEN GOTO ABORTED ! Error trap $ ON CONTROL_Y THEN GOTO ABORTED ! User-abort error trap $ USER = F$EDIT(F$GETJPI(0,"USERNAME"),"TRIM,LOWERCASE") ! Username $ SET DEFAULT SYS$LOGIN: ! Start with the home directory $ MYDIR = F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY") -- "[" - "]" + ".DIR;1" ! Home directory file name $ MYDIR = "[-]" + MYDIR ! Add relative path $ PROT = F$FILE_ATTRIBUTES(MYDIR,"PRO") ! Get file protection $ PROT = F$ELEMENT(3,",",PROT) - " " ! Just interested in WORLD $ IF F$LOCATE("E",PROT) .EQ. F$LENGTH(PROT) ! No WORLD execute $ THEN SAY "Adding WORLD execute access to home directory..." $ IF F$LOCATE("=",PROT) .EQ. F$LENGTH(PROT) THEN PROT = PROT + "=" $ SET SECURITY/PROTECTION=('PROT'E) 'MYDIR' $ ENDIF $ IF F$SEARCH("WWW.DIR;1") .EQS. "" ! No WWW subdirectory $ THEN SAY "Creating [.WWW] subdirectory..." $ CREATE/DIRECTORY [.WWW] ! Create a WWW subdirectory $ ENDIF $! Set up protection on the subdirectory and files created in it $ SAY "Setting WORLD read access to [.WWW] subdirectory..." $ SET SECURITY/PROTECTION=(S:RWE,O:RWE,G:RE,W:RE)- /ACL=(DEFAULT_PROTECTION,S:RWED,O:RWED,G:RE,W:RE) WWW.DIR;1 $ IF F$SEARCH("[.WWW]*.*;*") .NES. "" $ THEN SAY "Setting WORLD read access on files already in [.WWW]..." $ SET SECURITY/PROTECTION=(S:RWED,O:RWED,G:RE,W:RE) [.WWW...]*.*;* $ ELSE SAY "Copying SAMPLE.HTML and TIGER-HEAD.GIF to [.WWW]..." $ COPY/NOLOG/NOCONFIRM MSUTIL:SAMPLE.HTML [.WWW] $ COPY/NOLOG/NOCONFIRM XMSUTIL:TIGER-HEAD.GIF [.WWW] $ SAY "You can view the copied sample HTML file with the URL:" $ SAY "http://www.people.memphis.edu/~''USER'/sample.html" $ ENDIF $ IF F$SEARCH("[.WWW].WWW_MAILABLE") .EQS. "" $ THEN SAY "" $ SAY "You can use a ""/htbin/cgi-mailto/''USER'/subject"" script to mail" $ SAY "a form to yourself if you create a "".WWW_MAILABLE"" file in your" $ SAY "[.WWW] subdirectory." $ INQUIRE/NOPUN MAILABLE "Would you like me to create it for you [No]? " $ IF MAILABLE $ THEN CREATE [.WWW].WWW_MAILABLE $ SAY "The .WWW_MAILABLE file has been created." $ COPY/NOLOG/NOCONF MSUTIL:EXAMPLE_*FORM.* [.WWW] $ SAY "Example forms have also been copied for you." $ ELSE SAY "[Not creating .WWW_MAILABLE file for you.]" $ ENDIF $ ENDIF $ SAY "" $ SAY "You *must* place your HTML files in your [.WWW] subdirectory" $ SAY "for the www.people.memphis.edu HTTP server to locate them." $ SAY "Your URL is: ""http://www.people.memphis.edu/~''USER'" +- "/home.html""" $ SAY "(where ""home.html"" is the file name of your HTML home page)." $ SAY "If you create a home.html, welcome.html, or index.html file, it" $ SAY "will automatically be selected if no file is specified in the URL." $ SAY "" $ SAY "WWWSETUP complete." $ GOTO FINISHED $ ABORTED: $ SAY "WWWSETUP aborted... some tasks may not be complete." $ FINISHED: $ SET DEFAULT 'CURDIR' $ TYPE/NOPAGE SYS$INPUT: Reminder: The university's acceptable use policy governs what is appropriate to publish on your WWW pages; in particular, avoid copyrighted and pornographic materials which are illegal to distribute. $ SAY "(Current directory is ''CURDIR')" $ EXIT 1 + 0*F$VERIFY(SAVERIFY)