#!/bin/sh
-VERSION="$0 V 0.1 (C) 2001 Artur Frysiak"
+VERSION="$0 V 0.3 (c) 2001 Artur Frysiak, (c) 2005 Elan Ruusamäe"
COMMAND=usage
VERBOSE=""
MODNAME=""
echo "activating module '${MODNAME}.so' in ${INIFILE}" 1>&2
echo "extension=${MODNAME}.so" >> ${INIFILE}
fi
-
- # restart only if there's module installed
- if [ -f /etc/httpd/httpd.conf/??_mod_php4.conf ] && [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
- fi
- if [ -f /etc/apache/conf.d/??_mod_php4.conf ] && [ -f /var/lock/subsys/apache ]; then
- /etc/rc.d/init.d/apache restart 1>&2
- fi
}
deinstall()
{
if [ -f ${INIFILE} ] && grep -q "^extension[[:space:]]*=[[:space:]]*${MODNAME}.so" ${INIFILE}; then
- TMPFILE=`mktemp -q /tmp/php-module-install.XXXXXX`
- if [ $? -ne 0 ]; then
- echo "$0: Can't create temp file, exiting..."
- exit 1
- fi
- echo "deactivating module '${MODNAME}.so' in ${INIFILE}" 1>&2
- grep -v "^extension[[:space:]]*=[[:space:]]*${MODNAME}.so" > ${TMPFILE} < ${INIFILE}
- mv ${TMPFILE} ${INIFILE}
- chmod 644 ${INIFILE}
- fi
-
- # restart only if there's module installed
- if [ -f /etc/httpd/httpd.conf/??_mod_php4.conf ] && [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
- fi
- if [ -f /etc/apache/conf.d/??_mod_php4.conf ] && [ -f /var/lock/subsys/apache ]; then
- /etc/rc.d/init.d/apache restart 1>&2
+ sed -i -e "/^extension[[:space:]]*=[[:space:]]*${MODNAME}.so/d" ${INIFILE}
fi
}