File: postinst

package info (click to toggle)
php-imlib 0.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 572 kB
  • ctags: 430
  • sloc: ansic: 1,287; php: 626; sh: 94; makefile: 66
file content (61 lines) | stat: -rw-r--r-- 1,424 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/sh
# postinst script for php-imlib
#
# see: dh_installdeb(1)

set -e

case "$1" in
    configure)

	if [ -z "$2" ]; then
		if [ -f /etc/php4/apache/php.ini ]; then
			if ! grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*imlib.so" /etc/php4/apache/php.ini; then
				echo "You are installing Imlib support for php4, but it's not"
				echo "enabled in your /etc/php4/apache/php.ini."
				echo
				echo "To enable it you need to add this line:"
				echo
				echo "extension=imlib.so"
				echo
				echo -n "Do you want me to add it now [Y/n] ?"
				read a
				if ! echo $a | grep -iq ^n; then
					echo "extension=imlib.so" >> /etc/php4/apache/php.ini
				fi
			fi
		fi

		if [ -f /etc/php4/cgi/php.ini ]; then
		        if ! grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*imlib.so" /etc/php4/cgi/php.ini; then
				echo "You are installing Installing support for php4, but it's not"
				echo "enabled in your /etc/php4/cgi/php.ini."
				echo
				echo "To enable it you need to add this line:"
				echo
				echo "extension=imlib.so"
				echo
				echo -n "Do you want me to add it now [Y/n] ?"
				read a
				if ! echo $a | grep -iq ^n; then
					echo "extension=imlib.so" >> /etc/php4/cgi/php.ini
				fi
			fi
		fi
	fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

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


#DEBHELPER#

exit 0