File: prerm

package info (click to toggle)
libapache-mod-auth-pam 1.0a-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 96 kB
  • ctags: 28
  • sloc: ansic: 277; sh: 168; makefile: 42
file content (80 lines) | stat: -rw-r--r-- 2,376 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
set -e


# Automatically added by dh_installdocs
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/libapache-mod-auth-pam ]; then
        rm -f /usr/doc/libapache-mod-auth-pam
fi
# End automatically added section

# DJ: function to comment us out in httpd.conf
killconf () {
        if
        test -s /etc/apache/httpd.conf
        then
         tmpfile=/etc/apache/httpd.conf.tmp.$$
         cat /etc/apache/httpd.conf |\
                 sed 's/^\(LoadModule.*mod_auth_pam\.so\)/# \1/' > $tmpfile
         mv -f $tmpfile /etc/apache/httpd.conf
         ask_restart
        fi
}
killconfssl () {
         if
         test -s /etc/apache-ssl/httpd.conf
         then
          tmpfile=/etc/apache-ssl/httpd.conf.tmp.$$
          cat /etc/apache-ssl/httpd.conf |\
                  sed 's/^\(LoadModule.*mod_auth_pam\.so\)/# \1/' > $tmpfile
          mv -f $tmpfile /etc/apache-ssl/httpd.conf
          ask_restartssl
         fi
}
# Restart apache if user wants.
ask_restart () {
        echo -n "An Apache module has been modified.  Restart apache [Y/n]? "
        read CONFIG
        if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
        then
           if [ -x /usr/sbin/apachectl ]; then
                /usr/sbin/apachectl restart || true
           else
               echo 'apachectl not found.'
           fi
        fi
}
ask_restartssl () {
        echo -n "An Apache module has been modified.  Restart apache-ssl [Y/n]? "
        read CONFIG
        if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
        then
           if [ -x /usr/sbin/apache-sslctl ]; then
                /usr/sbin/apache-sslctl restart || true
           else
               echo 'apache-sslctl not found.'
           fi
        fi
}        
# This script is called twice during the removal of the package; once
# after the removal of the package's files from the system, and as
# the final step in the removal of this package, after the package's
# conffiles have been removed.

case "$1" in
  remove)
    # This package has been removed, but its configuration has not yet
    # been purged.
           killconf
           killconfssl
    :
    ;;
  upgrade | deconfigure | failed-upgrade)
        # I _think_ I'm right here...let it sit on an upgrade.
        :
        ;;
  *) echo "$0: didn't understand being called with \`$1'" 1>&2
     exit 1;;
esac

exit 0