File: prerm

package info (click to toggle)
php4-idn 1.1-1.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 324 kB
  • ctags: 109
  • sloc: ansic: 683; xml: 624; php: 90; makefile: 66; sh: 52
file content (31 lines) | stat: -rwxr-xr-x 817 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
#!/bin/sh

set -e

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

for pkg in apache cli cgi apache2; do
    if [ -f /etc/php4/$pkg/php.ini ]; then
	if grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*idn.so" /etc/php4/$pkg/php.ini; then
	    echo "You are removing IDN support for php4, but it is still"
	    echo "enabled in your /etc/php4/$pkg/php.ini."
	    echo
	    echo "You should remove this line:"
	    echo
	    echo "extension=idn.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/$pkg/php.ini | \
		    grep -v "^[[:space:]]*extension[[:space:]]*=[[:space:]]*idn.so" \
		    > /etc/php4/$pkg/php.ini.idnremove
		mv /etc/php4/$pkg/php.ini.idnremove /etc/php4/$pkg/php.ini
	    fi
	fi
    fi
done

exit 0