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

Last change on this file since 8172 was 8172, checked in by hectorgh, 7 months ago

moving test to preinst

File size: 1.1 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                fi
41
42        fi
43       
44    ;;
45    abort-upgrade)
46    ;;
47
48    *)
49        echo "preinst called with unknown argument \`$1'" >&2
50        exit 1
51    ;;
52esac
53
54# dh_installdeb will replace this with shell code automatically
55# generated by other debhelper scripts.
56
57#DEBHELPER#
58
59exit 0
Note: See TracBrowser for help on using the repository browser.