]> git.pld-linux.org Git - packages/php.git/blame - php-module-install
- release 0.2
[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{
11if [ -f ${INIFILE} ]; then
12 echo "activating module '${MODNAME}.so' in ${INIFILE}" 1>&2
13 perl -pi -e "s|^;extension=${MODNAME}.so|extension=${MODNAME}.so|g" ${INIFILE}
14fi
15if [ -f /var/lock/subsys/httpd ]; then
16 /etc/rc.d/init.d/httpd restart 1>&2
17fi
18}
19
20deinstall()
21{
22if [ -f ${INIFILE} ]; then
23 echo "deactivating module '${MODNAME}.so' in ${INIFILE}" 1>&2
24 perl -pi -e "s|^extension=${MODNAME}.so|;extension=${MODNAME}.so|g" $INIFILE
25fi
26if [ -f /var/lock/subsys/httpd ]; then
27 /etc/rc.d/init.d/httpd restart 1>&2
28fi
29}
30
31usage()
32{
33 echo $VERSION
34 echo "Usage:"
35 echo " $0 install MODNAME INIFILE"
36 echo " $0 remove MODNAME INIFILE"
37}
38
39if [ "$#" = 3 ]; then
40 MODNAME="$2"
41 INIFILE="$3"
42
20e49c68 43 if [ "$1" = "install" ]; then
b12a6a9f
AF
44 install
45 else
20e49c68 46 if [ "$1" = "remove" ]; then
b12a6a9f
AF
47 remove
48 else
49 usage
50 fi
51 fi
52else
53 usage
54 exit 1
55fi
56
This page took 0.035114 seconds and 4 git commands to generate.