X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=ee9870051c24d14016d331c9411ea8b338d8d790;hb=412d2d6b997923dc1dfb094e3cb40922efe56ff6;hp=a806b2bdac15cfa852890641c9f1d4317d526821;hpb=ac3f1fcff2b82980e6b2dda58ecd3339833b8764;p=php4-cn.git diff --git a/debian/postinst b/debian/postinst index a806b2b..ee98700 100755 --- a/debian/postinst +++ b/debian/postinst @@ -25,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" @@ -48,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 @@ -58,18 +58,27 @@ for php4ext in $EXTENSIONS; do # configuration files. for SAPI in apache apache2 cgi cli; do - ini_file="$PHP4DIR/$SAPI/php.ini" + if [ -d "$PHP4DIR/$SAPI" ]; then - if [ -f "$ini_file" ]; then + ini_file="$PHP4DIR/$SAPI/php.ini" + + if [ -f "$ini_file" ]; then cp_echo "CN: Removing $php4ext extension from file $ini_file" cp_check_and_sed "$php4ext_re" \ "/$php4ext_re/d" \ "$ini_file" && need_restart=1 || true - fi + fi + 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 @@ -109,25 +118,25 @@ done # for SAPI in apache apache2 cgi cli; do - if [ ! -d "$PHP5DIR/$SAPI" ]; then + if [ ! -d "$PHP4DIR/$SAPI" ]; then continue fi - ini_file="$PHP5DIR/$SAPI/php.ini" + ini_file="$PHP4DIR/$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$" \ + 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 - cp_check_and_sed "^[[:space:]]*memory_limit[[:space:]]*=[[:space:]]*16M$" \ + cp_check_and_sed "^[[:space:]]*memory_limit[[:space:]]*=[[:space:]]*8M" \ 's/^[[:space:]]*memory_limit[[:space:]]*=.*/memory_limit = 256M/' \ "$ini_file" && need_restart=1 || true fi