"Fossies" - the Fresh Open Source Software Archive

Member "mod_fastcgi-2.4.7-0910052141/debian/postinst" (10 Apr 2012, 3043 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 ask the user whether to reconfigure apache/apachessl.
    7 do_enable () {
    8   if [ -s /etc/apache/httpd.conf ] ; then
    9     if grep '^LoadModule.*mod_fastcgi\.so' /etc/apache/httpd.conf 2>&1 >/dev/null
   10     then
   11       exit 0
   12     fi
   13   fi
   14   echo -n "A new Apache module has been installed.  Reconfigure apache [Y/n]? "
   15   read CONFIG
   16   case "$CONFIG" in
   17     [nN]*) # user said no
   18       echo -n ""  # do nothing
   19       ;;
   20     *)     # user said yes
   21       if [ -x /usr/sbin/apacheconfig ] ; then
   22         /usr/sbin/apacheconfig --force-modules
   23       fi
   24       ;;
   25   esac
   26 }
   27 
   28 do_enablessl () {
   29   if [ -s /etc/apache-ssl/httpd.conf ] ; then
   30     if grep '^LoadModule.*mod_fastcgi\.so' /etc/apache-ssl/httpd.conf 2>&1 >/dev/null ; then
   31       exit 0
   32     fi
   33   fi
   34   echo -n "A new Apache module has been installed.  Reconfigure apache-ssl [Y/n]? "
   35   read CONFIG
   36   case "$CONFIG" in
   37     [nN]*)  # user said no
   38       echo -n ""  # do nothing
   39       ;;
   40     *)      # user said yes
   41       if [ -x /usr/sbin/apache-sslconfig ] ; then
   42         /usr/sbin/apache-sslconfig --force-modules
   43       fi
   44       ;;
   45   esac
   46 }
   47 
   48 # These functions ask the user whether to restart apache/apachessl.
   49 ask_restart () {
   50   echo -n "An Apache module has been modified.  Restart apache [Y/n]? "
   51   read CONFIG
   52   case "$CONFIG" in
   53     [nN]*)  # user said no
   54       echo -n ""  # do nothing
   55       ;;
   56     *)      # user said yes
   57       /usr/sbin/apachectl restart
   58       ;;
   59   esac
   60 }
   61 ask_restartssl () {
   62   echo -n "An Apache module has been modified.  Restart apache-ssl [Y/n]? "
   63   read CONFIG
   64   case "$CONFIG" in
   65     [nN]*)  # user said no
   66       echo -n ""  # do nothing
   67       ;;
   68     *)      # user said yes
   69       /usr/sbin/apache-sslctl restart
   70       ;;
   71   esac
   72 }
   73 
   74 case "$1" in
   75   configure)
   76     # Configure this package.  If the package must prompt the user for
   77     # information, do it here.  There are three sub-cases.
   78     if [ "${2+set}" != "set" ] ; then
   79       # We're being installed by an ancient dpkg which doesn't remember
   80       # which version was most recently configured, or even whether
   81       # there is a most recently configured version.
   82       if [ -s /etc/apache/httpd.conf ]     ; then do_enable    ; fi
   83       if [ -s /etc/apache-ssl/httpd.conf ] ; then do_enablessl ; fi
   84     elif [ -z "$2" -o "$2" = "<unknown>" ] ; then
   85       # The package has not ever been configured on this system, or was
   86       # purged since it was last configured.
   87       # DJ: So let's do_enable the module!
   88       if [ -s /etc/apache/httpd.conf ]     ; then do_enable    ; fi
   89       if [ -s /etc/apache-ssl/httpd.conf ] ; then do_enablessl ; fi
   90     else
   91       # Version $2 is the most recently configured version of this
   92       # package.
   93       if [ -x /usr/sbin/apachectl     ] ; then ask_restart    ; fi
   94       if [ -x /usr/sbin/apache-sslctl ] ; then ask_restartssl ; fi
   95     fi
   96     ;;
   97   abort-upgrade | abort-remove | abort-deconfigure)
   98     ;;
   99   *)
  100     echo "$0: didn't understand being called with \`$1'" 1>&2
  101     exit 1
  102     ;;
  103 esac
  104 
  105 exit 0
  106 
  107 #DEBHELPER#