X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=php4-cn.git;a=blobdiff_plain;f=debian%2Fpostinst;h=034b224d89b66462b77f960f8462f19eb6d7bf87;hp=5a3279c7958e8b799fdcfbf5cc5541745b91646c;hb=c6ad045eb89e880ffa34599c751488db78766a7e;hpb=b3a467537d3200a343868f8d57b25c1d8d11e8ff diff --git a/debian/postinst b/debian/postinst index 5a3279c..034b224 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,9 +4,6 @@ set -e [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx -# Source debconf library. -. /usr/share/debconf/confmodule - case "$1" in configure) # continue below @@ -28,7 +25,7 @@ esac PKG="php4-cn" A2MODEDIR="/etc/apache2/mods-enabled" -EXTENSIONS="mysql ldap gd" +EXTENSIONS="mysql" PHP4DIR="/etc/php4" PHP4CONFD="/etc/php4/conf.d" @@ -51,7 +48,7 @@ if [ -e /etc/apache2/apache2.conf ]; then fi -# Check if PHP4 extensions (MySQL, LDAP, GD) are enabled. +# Check if PHP4 extensions are enabled. # for php4ext in $EXTENSIONS; do @@ -73,6 +70,12 @@ for php4ext in $EXTENSIONS; do fi done + # Check $PHP4CONFD directory. + if [ ! -d "$PHP4CONFD" ]; then + cp_echo "CN: Creating configuration directory $PHP4CONFD" + mkdir $PHP4CONFD + fi + # Check extension configuration in /etc/php4/conf.d/ directory. if [ ! -f "$PHP4CONFD/$php4ext.ini" ]; then @@ -112,17 +115,21 @@ done # for SAPI in apache apache2 cgi cli; do - ini_file="$PHP4DIR/$SAPI/php.ini" + if [ ! -d "$PHP5DIR/$SAPI" ]; then + continue + fi - cp_echo "CN: Checking and enabling some CARNet specific parameters in file $ini_file" + ini_file="$PHP5DIR/$SAPI/php.ini" + cp_echo "CN: Checking and enabling some CARNet specific parameters in file $ini_file" + if [ -f "$ini_file" ]; then cp_check_and_sed "^[[:space:]]*upload_max_filesize[[:space:]]*=[[:space:]]*2M$" \ 's/^[[:space:]]*upload_max_filesize[[:space:]]*=.*/upload_max_filesize = 256M/' \ "$ini_file" && need_restart=1 || true - cp_check_and_sed "^[[:space:]]*post_max_size[[:space]]*=[[:space:]]*8M$" \ + cp_check_and_sed "^[[:space:]]*post_max_size[[:space:]]*=[[:space:]]*8M$" \ 's/^[[:space:]]*post_max_size[[:space:]]*=.*/post_max_size = 256M/' \ "$ini_file" && need_restart=1 || true @@ -163,14 +170,14 @@ done if [ $need_restart -eq 1 ]; then # Check Apache2 web server configuration. - if apache2ctl configtest 2>/dev/null; then + if /usr/sbin/apache2ctl configtest 2>/dev/null; then # Restart Apache2 web server. if [ -x "/etc/init.d/apache2" ]; then if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d apache2 restart || exit $? + invoke-rc.d apache2 force-reload || true else - /etc/init.d/apache2 restart || exit $? + /etc/init.d/apache2 force-reload || true fi fi else