Always try to restore apache configs.
authorValentin Vidic <vvidic@carnet.hr>
Wed, 20 Feb 2008 15:16:39 +0000 (16:16 +0100)
committerValentin Vidic <vvidic@carnet.hr>
Wed, 20 Feb 2008 15:16:39 +0000 (16:16 +0100)
src/functions.sh

index 168bc91..80e1894 100644 (file)
@@ -523,6 +523,20 @@ restore_configs () {
           rm -vf "$file"
       done
   fi
+
+  # register cn changes in apache files
+  for config in /etc/php4/cgi/php.ini \
+                /etc/php4/cli/php.ini \
+                /etc/php4/apache/php.ini \
+                /etc/php4/apache2/php.ini \
+                /etc/apache/modules.conf
+  do 
+      config_backup=$config.$backup_ext
+      if [ -e $config -a ! -e $config_backup ]; then
+          cp -av $config $config_backup
+          ucf $config_backup $config
+      fi
+  done
 }
 
 # temporary disable listchanges packages to reduce clutter during upgrade
@@ -597,20 +611,6 @@ upgrade_apache () {
       eval apt-get --yes remove $delpkg
   fi
 
-  # register cn changes in apache files
-  for config in /etc/php4/cgi/php.ini \
-                /etc/php4/cli/php.ini \
-                /etc/php4/apache/php.ini \
-                /etc/php4/apache2/php.ini \
-                /etc/apache/modules.conf
-  do 
-      config_backup=$config.$backup_ext
-      if [ ! -e $config_backup ]; then
-          cp -av $config $config_backup
-          ucf $config_backup $config
-      fi
-  done
-
   # remove old apache
   pkgrm apache apache-common