File: postinst

package info (click to toggle)
php3 3%3A3.0.18-0potato1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 17,736 kB
  • ctags: 11,198
  • sloc: ansic: 108,120; sh: 2,512; php: 2,024; yacc: 1,887; makefile: 1,038; perl: 537; pascal: 238; awk: 90; cpp: 28; sql: 11
file content (92 lines) | stat: -rw-r--r-- 3,550 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
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
90
91
92
#!/bin/sh

set -e

if [ "$1" != "configure" ]; then
    exit 0
fi


if [ -f /etc/apache/httpd.conf ]; then 
    if ! grep -q "^LoadModule.*php3.so" /etc/apache/httpd.conf; then
	echo "I see you have apache webserver installed and so far you haven't";
	echo "used the apache module version of php3 in your apache. If you";
	echo "want to use it, you should reconfigure the apache webserver and";
	echo "select to load the php module. I can call the apacheconfig script";
	echo "now for you to do it, or you can insert the following line into"; 
	echo "/etc/apache/httpd.conf manually:";
	echo 
	echo "LoadModule php3_module /usr/lib/apache/1.3/libphp3.so";
	echo
	echo -n "Do you want me to run the apacheconfig script now [y/N] ? ";
	read a;
	if echo $a | grep -qi ^y; then
		[ -x /usr/sbin/apacheconfig ] && /usr/sbin/apacheconfig
	else
		echo "Ok, not running apacheconfig. Please read the docs in /usr/share/doc/php3"
		echo -n "Press RETURN to continue"
		read a;
	fi
   elif grep -q "^LoadModule.*mod_php3.so" /etc/apache/httpd.conf; then
	echo "The module name of php3 has changed from mod_php3.so to libphp3.so"
	echo "Apache will not start until it is fixed either by this script or manually"
	echo -n "Should I fix this in /etc/apache/httpd.conf ? [Y/n] "
	read a;
	if echo $a | grep -qi ^n; then
		echo "Ok, I warned you. Please fix it manually"
	else
		mv /etc/apache/httpd.conf /etc/apache/httpd.conf.php3save
		sed s/mod_php3.so/libphp3.so/ </etc/apache/httpd.conf.php3save >/etc/apache/httpd.conf
		echo "Done, please check /etc/apache/httpd.conf (the old one has been saved into"
		echo "/etc/apache/httpd.conf.php3save), and then restart apache"
	fi
	echo -n "Press RETURN to continue"
	read a;
   fi
fi

if [ -f /etc/apache-ssl/httpd.conf ]; then 
    if ! grep -q "^LoadModule.*php3.so" /etc/apache-ssl/httpd.conf; then
	echo "I see you have apache-ssl webserver installed and so far you haven't";
	echo e"used the apache module version of php3 in your apache-ssl. If you";
	echo "want to use it, you should reconfigure the apache-ssl webserver and";
	echo "select to load the php module. I can call the apache-sslconfig script";
	echo "now for you to do it, or you can insert the following line into"; 
	echo "/etc/apache-ssl/httpd.conf manually:";
	echo 
	echo "LoadModule php3_module /usr/lib/apache/1.3/libphp3.so";
	echo
	echo -n "Do you want me to run the apache-sslconfig script now [y/N] ? ";
	read a;
	if echo $a | grep -qi ^y; then
		[ -x /usr/sbin/apache-sslconfig ] && /usr/sbin/apache-sslconfig
	else
		echo "Ok, not running apache-sslconfig. Please read the docs in /usr/share/doc/php3"
		echo -n "Press RETURN to continue"
		read a;
	fi
   elif grep -q "^LoadModule.*mod_php3.so" /etc/apache-ssl/httpd.conf; then
	echo "The module name of php3 has changed from mod_php3.so to libphp3.so"
	echo "Apache will not start until it is fixed either by this script or manually"
	echo -n "Should I fix this in /etc/apache-ssl/httpd.conf ? [Y/n] "
	read a;
	if echo $a | grep -qi ^n; then
		echo "Ok, I warned you. Please fix it manually"
	else
		mv /etc/apache-ssl/httpd.conf /etc/apache-ssl/httpd.conf.php3save
		sed s/mod_php3.so/libphp3.so/ </etc/apache-ssl/httpd.conf.php3save >/etc/apache-ssl/httpd.conf
		echo "Done, please check /etc/apache-ssl/httpd.conf (the old one has been saved into"
		echo "/etc/apache-ssl/httpd.conf.php3save), and then restart apache-ssl"
	fi
	echo -n "Press RETURN to continue"
	read a;
   fi
fi

if [ -f /etc/php3.ini ]; then
	mv /etc/php3.ini /etc/php3.ini.dpkg-old
fi

#DEBHELPER#

exit 0