File: preinst

package info (click to toggle)
apache 1.3.26-0woody6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,572 kB
  • ctags: 196
  • sloc: ansic: 1,679; perl: 779; sh: 543; makefile: 411
file content (47 lines) | stat: -rw-r--r-- 950 bytes parent folder | download | duplicates (2)
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
#! /bin/sh
# preinst script for apache
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>

case "$1" in
    install|upgrade)

    # See which version was installed.

    if [ "$1" = install -o "$1" = upgrade ] && [ "$2" != "" ]
    then
	if [ ! -d /etc/apache -a -d /etc/httpd ]
	then
	    echo Copying existing configuration from "\`/etc/httpd'" to "\`/etc/apache'..."
	    mkdir -m 755 /etc/apache &&
		(cd /etc/httpd; tar cf - .) | (cd /etc/apache; tar xpf -)
	fi
    fi

    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0