File: preinst

package info (click to toggle)
apache 1.3.0-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,488 kB
  • ctags: 6,702
  • sloc: ansic: 47,562; sh: 3,221; makefile: 1,382; perl: 1,346; cpp: 55
file content (35 lines) | stat: -rw-r--r-- 810 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
#!/bin/sh -e

if ! grep -q "^www-data:" /etc/passwd;
then
    echo -n "The www-data user is missing!  Attempt to fix? "
    read X
    if [ "$X" = "Y" -o "$X" = "y" ];
    then
	echo "Here goes nothing ... "
	/usr/sbin/update-passwd
    fi
fi

if ! grep -q "^www-data:" /etc/group;
then
    echo -n "The www-data group is missing!  Attempt to fix? "
    read X
    if [ "$X" = "Y" -o "$X" = "y" ];
    then
	echo "Here goes nothing ... "
	/usr/sbin/update-passwd
    fi
fi

# 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