]> git.pld-linux.org Git - packages/php.git/blame - php-module-install
- don't use pcre functions in standard/aggregation functions if building pcre extensi...
[packages/php.git] / php-module-install
CommitLineData
b12a6a9f
AF
1#!/bin/sh
2
3VERSION="$0 V 0.1 (C) 2001 Artur Frysiak"
4COMMAND=usage
5VERBOSE=""
6MODNAME=""
7INIFILE=""
8
9install ()
10{
0c4981f1 11if [ -f ${INIFILE} ] && ! grep -q "^extension[[:space:]]*=[[:space:]]*${MODNAME}.so" ${INIFILE} ; then
b12a6a9f 12 echo "activating module '${MODNAME}.so' in ${INIFILE}" 1>&2
0c4981f1 13 echo "extension=${MODNAME}.so" >> ${INIFILE}
b12a6a9f
AF
14fi
15if [ -f /var/lock/subsys/httpd ]; then
16 /etc/rc.d/init.d/httpd restart 1>&2
17fi
18}
19
20deinstall()
21{
0c4981f1 22if [ -f ${INIFILE} ] && grep -q "^extension[[:space:]]*=[[:space:]]*${MODNAME}.so" ${INIFILE} ; then
8a39eeea 23 TMPFILE=`mktemp -q /tmp/php-module-install.XXXXXX`
0c4981f1
AF
24 if [ $? -ne 0 ]; then
25 echo "$0: Can't create temp file, exiting..."
26 exit 1
27 fi
b12a6a9f 28 echo "deactivating module '${MODNAME}.so' in ${INIFILE}" 1>&2
0c4981f1
AF
29 grep -v "^extension[[:space:]]*=[[:space:]]*${MODNAME}.so" > ${TMPFILE} < ${INIFILE}
30 mv ${TMPFILE} ${INIFILE}
9d6174b1 31 chmod 644 ${INIFILE}
b12a6a9f
AF
32fi
33if [ -f /var/lock/subsys/httpd ]; then
34 /etc/rc.d/init.d/httpd restart 1>&2
35fi
36}
37
38usage()
39{
40 echo $VERSION
41 echo "Usage:"
42 echo " $0 install MODNAME INIFILE"
43 echo " $0 remove MODNAME INIFILE"
44}
45
46if [ "$#" = 3 ]; then
47 MODNAME="$2"
48 INIFILE="$3"
49
20e49c68 50 if [ "$1" = "install" ]; then
b12a6a9f
AF
51 install
52 else
20e49c68 53 if [ "$1" = "remove" ]; then
0c4981f1 54 deinstall
b12a6a9f
AF
55 else
56 usage
57 fi
58 fi
59else
60 usage
61 exit 1
62fi
63
368dce0b 64exit 0
This page took 0.050451 seconds and 4 git commands to generate.