r5: * Prepravljen nacin restartanja Apache2 web servera.
[php5-cn.git] / debian / postinst
index 4d73590..196c904 100755 (executable)
@@ -112,17 +112,21 @@ done
 #
 for SAPI in apache apache2 cgi cli; do
 
+       if [ ! -d "$PHP5DIR/$SAPI" ]; then
+               continue
+       fi
+
        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 +167,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