source: export-web-sites/trunk/fuentes/debian/export-web-sites-server.preinst @ 8371

Last change on this file since 8371 was 8371, checked in by daduve, 4 months ago

adding new module to apache server proxy_html

File size: 1.4 KB
Line 
1#!/bin/sh
2# preinst script for pepito
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <new-preinst> `install'
10#        * <new-preinst> `install' <old-version>
11#        * <new-preinst> `upgrade' <old-version>
12#        * <old-preinst> `abort-upgrade' <new-version>
13# for details, see https://www.debian.org/doc/debian-policy/ or
14# the debian-policy package
15
16
17case "$1" in
18    install)
19    ;;
20   
21    upgrade)
22
23
24        if dpkg --compare-versions "$2" lt 0.1; then
25
26                RC=0
27               
28                grep "lliurex-location" /etc/apache2/sites-enabled/000-default.conf 1>/dev/null 2>/dev/null || RC=1
29               
30                if [ $RC = 0 ]; then
31                       
32                        if [ ! -h "/etc/apache2/mods-enabled/proxy.conf" -o ! -h "/etc/apache2/mods-enabled/proxy.load" ]; then
33                       
34                                echo "Fixing proxy module in Apache2 Service....."
35                                a2enmod proxy_http >/dev/null || true
36                                service apache2 restart
37                               
38                        fi
39                       
40                        if [ ! -h "/etc/apache2/mods-enabled/proxy_html.conf" -o ! -h "/etc/apache2/mods-enabled/proxy_html.load" ]; then
41                       
42                                echo "Fixing proxy module in Apache2 Service....."
43                                a2enmod proxy_html >/dev/null || true
44                                service apache2 restart
45                               
46                        fi
47                       
48                fi
49
50        fi
51       
52    ;;
53    abort-upgrade)
54    ;;
55
56    *)
57        echo "preinst called with unknown argument \`$1'" >&2
58        exit 1
59    ;;
60esac
61
62# dh_installdeb will replace this with shell code automatically
63# generated by other debhelper scripts.
64
65#DEBHELPER#
66
67exit 0
Note: See TracBrowser for help on using the repository browser.