]> git.pld-linux.org Git - packages/php.git/blob - php-module-install
- obsolete at last
[packages/php.git] / php-module-install
1 #!/bin/sh
2
3 VERSION="$0 V 0.3 (c) 2001 Artur Frysiak, (c) 2005 Elan Ruusamäe"
4 COMMAND=usage
5 VERBOSE=""
6 MODNAME=""
7 INIFILE=""
8
9 install()
10 {
11         if [ -f ${INIFILE} ] && ! grep -q "^extension[[:space:]]*=[[:space:]]*${MODNAME}.so" ${INIFILE}; then
12                 echo "activating module '${MODNAME}.so' in ${INIFILE}" 1>&2
13                 echo "extension=${MODNAME}.so" >> ${INIFILE}
14         fi
15 }
16
17 deinstall()
18 {
19         if [ -f ${INIFILE} ] && grep -q "^extension[[:space:]]*=[[:space:]]*${MODNAME}.so" ${INIFILE}; then
20                 sed -i -e "/^extension[[:space:]]*=[[:space:]]*${MODNAME}.so/d" ${INIFILE}
21         fi
22 }
23
24 usage()
25 {
26         echo $VERSION
27         echo "Usage:"
28         echo " $0 install MODNAME INIFILE"
29         echo " $0 remove  MODNAME INIFILE"
30 }
31
32 if [ "$#" = 3 ]; then
33         MODNAME="$2"
34         INIFILE="$3"
35
36         if [ "$1" = "install" ]; then
37                 install
38         else
39                 if [ "$1" = "remove" ]; then
40                         deinstall
41                 else
42                         usage
43                 fi
44         fi
45 else
46         usage
47         exit 1
48 fi
49
50 exit 0
This page took 0.030118 seconds and 3 git commands to generate.