File: libapache-mod-mono.postinst

package info (click to toggle)
mod-mono 1.2.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,640 kB
  • ctags: 230
  • sloc: sh: 8,606; ansic: 1,750; makefile: 120
file content (89 lines) | stat: -rw-r--r-- 1,589 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
81
82
83
84
85
86
87
88
89
#!/bin/bash -e

set -e

. /usr/share/debconf/confmodule
db_version 2.0


apachecfg="/etc/apache"
modmono_conf="$apachecfg/conf.d/mono.conf"
tempfile=`/bin/tempfile`
restart=""

activate_module() {
for i in apache apache-ssl; do
        if [ -e $apachecfg ]; then
            if [ -d /etc/$i ]; then
                modules-config $i enable libmod_mono
            fi
        fi
done

}

disable_module() {
for i in apache apache-ssl; do
        if [ -e $apachecfg ]; then
            if [ -d /etc/$i ]; then
                modules-config $i disable libmod_mono
            fi
	fi
done
       
}

add_monoserver_conf() {
   webservers="apache-ssl apache"

   # wwwconfig way! I love it!
   for server in $webservers; do
       includefile=/etc/mono-server/mono-server-hosts.conf
       conffile=/etc/apache/httpd.conf
       . /usr/share/wwwconfig-common/apache-include.sh
       if [ "$status" = "uncomment" -o "$status" = "include" ]; then
	   restart="$restart $server"
       fi
   done
}


restart_apache() {
    servers="apache-ssl apache"
    . /usr/share/wwwconfig-common/restart.sh
}


case "$1" in
    configure)
    db_get libapache-mod-mono/activate
    modmono_activate="$RET"

    if [ "$modmono_activate" = "true" ]; then
        activate_module
    else
	disable_module
    fi

    add_monoserver_conf
    restart_apache
    
    rm -Rf $tempfile

    
    # Should we restart Apache?
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        #Do nothing..
    ;;

    *)
        echo "postinst failed \`$1'" >&2
        exit 0
        ;;
esac

#DEBHELPER#

exit 0