"Fossies" - the Fresh Open Source Software Archive

Member "mod_fastcgi-2.4.7-0910052141/debian/prerm" (10 Apr 2012, 1949 Bytes) of package /linux/www/apache_httpd_modules/old/mod_fastcgi-2.4.7-0910052141.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 # vim: set ts=2 sw=2 et:
    3 
    4 set -e
    5 
    6 # These functions comment out the LoadModule directive in httpd.conf
    7 # for apache/apache-ssl.  They also ask the user whether to restart
    8 # apache/apache-ssl.
    9 killconf () {
   10   src=/etc/apache/httpd.conf
   11   dst=/etc/apache/httpd.conf.tmp.$$
   12   if [ -s $src ] ; then
   13     sed 's/^\(LoadModule.*mod_fastcgi\.so\)/# \1/' $src > $dst
   14     mv -f $dst $src
   15     ask_restart
   16   fi
   17 }
   18 killconfssl () {
   19   src=/etc/apache-ssl/httpd.conf
   20   dst=/etc/apache-ssl/httpd.conf.tmp.$$
   21   if [ -s $src ] ; then
   22     sed 's/^\(LoadModule.*mod_fastcgi\.so\)/# \1/' $src > $dst
   23     mv -f $src $dst
   24     ask_restartssl
   25   fi
   26 }
   27 
   28 # These functions ask the user whether to restart apache/apachessl.
   29 ask_restart () {
   30   echo -n "An Apache module has been modified.  Restart apache [Y/n]? "
   31   read CONFIG
   32   if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
   33   then
   34     if [ -x /usr/sbin/apachectl ]; then
   35       /usr/sbin/apachectl restart || true
   36     else
   37       echo 'apachectl not found.'
   38     fi
   39   fi
   40 }
   41 ask_restartssl () {
   42   echo -n "An Apache module has been modified.  Restart apache-ssl [Y/n]? "
   43   read CONFIG
   44   if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ] ; then
   45     if [ -x /usr/sbin/apache-sslctl ]; then
   46       /usr/sbin/apache-sslctl restart || true
   47     else
   48       echo 'apache-sslctl not found.'
   49     fi
   50   fi
   51 }        
   52 
   53 # This script is called twice during the removal of the package; once
   54 # after the removal of the package's files from the system, and as
   55 # the final step in the removal of this package, after the package's
   56 # conffiles have been removed.
   57 
   58 case "$1" in
   59   remove)
   60     # This package has been removed, but its configuration has not yet
   61     # been purged.
   62     killconf
   63     killconfssl
   64     :
   65     ;;
   66   upgrade | deconfigure | failed-upgrade)
   67     # I _think_ I'm right here...let it sit on an upgrade.
   68     :
   69     ;;
   70   *)
   71     echo "$0: didn't understand being called with \`$1'" 1>&2
   72     exit 1
   73     ;;
   74 esac
   75 
   76 exit 0
   77 
   78 #DEBHELPER#