File: php4-pgsql.prerm

package info (click to toggle)
php4-pgsql 3%3A4.1.2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 764 kB
  • ctags: 215
  • sloc: sh: 6,973; ansic: 1,588; makefile: 74; awk: 43
file content (47 lines) | stat: -rw-r--r-- 1,379 bytes parent folder | download
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

set -e

#DEBHELPER#

if [ "$1" != "remove" -a "$1" != "purge" ]; then
	exit 0
fi

if [ -f /etc/php4/apache/php.ini ]; then
	if grep -q "^extension[[:space:]]*=[[:space:]]*pgsql.so" /etc/php4/apache/php.ini; then
		echo "You are removing PostgreSQL support for php4, but it is still"
		echo "enabled in your /etc/php4/apache/php.ini."
		echo
		echo "You should remove this line:"
		echo
		echo "extension=pgsql.so"
		echo
		echo -n "Do you want me to do it now [Y/n] ?"
		read a
		if ! echo $a | grep -iq ^n; then
			cat /etc/php4/apache/php.ini |grep -v "^[[:space:]]*extension[[:space:]]*=[[:space:]]*pgsql.so" > /etc/php4/apache/php.ini.pgsqlremove
			mv /etc/php4/apache/php.ini.pgsqlremove /etc/php4/apache/php.ini
		fi
	fi
fi

if [ -f /etc/php4/cgi/php.ini ]; then
	if grep -q "^extension[[:space:]]*=[[:space:]]*pgsql.so" /etc/php4/cgi/php.ini; then
		echo "You are removing PostgreSQL support for php4, but it is still"
		echo "enabled in your /etc/php4/cgi/php.ini."
		echo
		echo "You should remove this line:"
		echo
		echo "extension=pgsql.so"
		echo
		echo -n "Do you want me to do it now [Y/n] ?"
		read a
		if ! echo $a | grep -iq ^n; then
			cat /etc/php4/cgi/php.ini |grep -v "^[[:space:]]*extension[[:space:]]*=[[:space:]]*pgsql.so" > /etc/php4/cgi/php.ini.pgsqlremove
			mv /etc/php4/cgi/php.ini.pgsqlremove /etc/php4/cgi/php.ini
		fi
	fi
fi

exit 0