$!----------------------------------------------------------------------------- $! SHUTDOWN.COM $! $! Example WASD HTTPd server shutdown procedure. $! $! Causes the WASD server to exit immediately. $! Removes known WASD utilities and applications INSTALLed as known images. $! If P1 is an integer between 2 and 15 will shtudown that WASD environment. $! If multiple WASD environments share the WASD_ROOT tree then this procedure $! may unINSTALL images for ALL of those environments! $! $! DO NOT MODIFY THIS PROCEDURE! $! ***************************** $! $! Copyright (C) 1996-2021 Mark G.Daniel. $! $! Licensed under the Apache License, Version 2.0 (the "License"); $! you may not use this file except in compliance with the License. $! You may obtain a copy of the License at $! $! http://www.apache.org/licenses/LICENSE-2.0 $! $! Unless required by applicable law or agreed to in writing, software $! distributed under the License is distributed on an "AS IS" BASIS, $! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. $! See the License for the specific language governing permissions and $! limitations under the License. $! $! VERSION HISTORY $! --------------- $! 11-JUL-2009 MGD v10 and pre-v10 logical names $! WASD autonomous environments $! 05-FEB-2006 MGD initial $!----------------------------------------------------------------------------- $! $ set noon $ say = "write sys$output" $! $ say "%WASD-I-SHUTDOWN, begin" $! $!(set up process' LNM$_FILE_DEV for v10.0 and later) $ if f$type(P1) .eqs. "INTEGER" .and. P1 .ge. 2 $ then $ if P1 .gt. 15 $ then $ write sys$output "%SHUTDOWN-E-ENV, out-of-range" $ exit %X10000014 $ endif $ wasd_file_dev = "WASD_FILE_DEV_" + f$string(P1) $ envis = "/ENV=" + f$string(P1) $ else $ wasd_file_dev = "WASD_FILE_DEV" $ envis = "" $ endif $ if f$trnlnm(wasd_file_dev) .nes. "" then @'wasd_file_dev' 'P1' $! $ if f$trnlnm("WASD_EXE") .nes. "" $ then $! (all possibilities) $ call shutdown wasd_exe:httpd.exe $ call shutdown wasd_exe:httpd_ssl.exe $ call remove wasd_exe:httpd.exe $ call remove wasd_exe:httpd_ssl.exe $ else $! (ditto) $ call shutdown ht_exe:httpd.exe $ call shutdown ht_exe:httpd_ssl.exe $ call remove ht_exe:httpd.exe $ call remove ht_exe:httpd_ssl.exe $ endif $! $!(commonly INSTALLed WASD utilities/applications) $ call remove cgi_exe:pcache.exe $ call remove cgi-bin:[000000]pcache.exe $ call remove cgi_exe:qdlogstats.exe $ call remove cgi-bin:[000000]qdlogstats.exe $ call remove cgi_exe:soymail.exe $ call remove cgi-bin:[000000]soymail.exe $ call remove cgi_exe:yahmail.exe $ call remove cgi-bin:[000000]yahmail.exe $! $ say "%WASD-I-SHUTDOWN, end" $ exit $! $ shutdown : subroutine $ if f$search(p1) .eqs. "" then exit $ if .not. f$file(p1,"known") then exit $ httpd = "$" + P1 $ set verify $ httpd /do=exit=now 'envis' $! 'f$verify(0) $ wait 00:00:02 $ exit $ endsubroutine $! $ remove : subroutine $ if f$search(p1) .eqs. "" then exit $ if .not. f$file(p1,"known") then exit $ install = "$sys$system:install/command_mode" $ set verify $ install remove 'p1' $! 'f$verify(0) $ exit $ endsubroutine $! $!-----------------------------------------------------------------------------