Added restore_config actions. Fixed small function bugs.
authorValentin Vidic <vvidic@carnet.hr>
Tue, 18 Dec 2007 14:03:55 +0000 (15:03 +0100)
committerValentin Vidic <vvidic@carnet.hr>
Tue, 18 Dec 2007 14:03:55 +0000 (15:03 +0100)
usr/share/carnet-upgrade/actions/main.queue
usr/share/carnet-upgrade/functions.sh

index c9560b9..50bb5b1 100644 (file)
@@ -2,13 +2,13 @@
 # Ivan 'ico' Rako <irako@srce.hr>
 # Zoran Dzelajlija <jelly@srce.hr>
 true                           first_warning
-true                           check_upgrade
-true                           remove_bloat
+#true                          check_upgrade
+#true                          remove_bloat
 true                           comment_force_overwrite # ruzna opcija za dpkg
 pkg libpam-skey                        pkgrm libpam-skey
 pkg skey-cn                    pkgrm skey-cn
-pkg getunix                    pkgrm getunix           # obsolete
-pkg getunix-cn                 pkgrm getunix-cn
+#pkg getunix                   pkgrm getunix           # obsolete
+#pkg getunix-cn                        pkgrm getunix-cn
 true                           fix_xinetd_conf         # ima i post-upgrade provjeru
 #pkg uw-imapd-ssl-cn           post_upgrade pkgrm uw-imapd-ssl
 pkg lynx-ssl-cn                        post_upgrade pkgadd lynx-cn
@@ -24,7 +24,40 @@ true                         create_sources_list
 true                           update                  # apt-get update & download
 true                           check_disk_space
 ! debconf_priority check       debconf_priority set    # utisaj debconf
+# popravi konfiguracije koje stvaraju probleme
+pkg amavisd-cn                 restore_config /etc/amavis/amavisd.conf
+pkg mysql-cn                   restore_config /etc/mysql/my.cnf
+pkg php4-cn                    restore_config /etc/php4/apache/php.ini
+pkg php4-cn                    restore_config /etc/php4/cgi/php.ini
+pkg php4-cn                    restore_config /etc/php4/cli/php.ini
+pkg dovecot-cn                 restore_config /etc/dovecot/dovecot.conf
+pkg bind9-cn                   restore_config /etc/bind/named.conf.options
+pkg kernel-2.6-cn              restore_config /etc/security/limits.conf
+pkg mysql-cn                   restore_config /etc/init.d/mysql
+pkg openldap-aai               restore_config /etc/init.d/slapd
+pkg openldap-aai               restore_config /etc/default/slapd
+pkg xinetd-cn                  restore_config /etc/xinetd.conf
+pkg vsftpd-cn                  restore_config /etc/vsftpd.conf
+pkg ntp-cn                     restore_config /etc/ntp.conf
+pkg ntp-cn                     restore_config /etc/default/ntpdate
+pkg squirrelmail-cn            restore_config /etc/squirrelmail/apache.conf
+pkg oidentd-cn                 restore_config /etc/default/oidentd
+pkg postfix-cn                 restore_config /etc/default/postgrey
+pkg postfix-cn                 restore_config /etc/default/saslauthd
+#pkg x                 restore_config /etc/sysctl.conf
+#pkg x                 restore_config /etc/apt/sources.list
+#pkg x                 restore_config /etc/default/aide
+#pkg x                 restore_config /etc/logrotate.d/mysql-server
+#pkg x                 restore_config /etc/aide/aide.conf
+#pkg x                 restore_config /etc/cron.daily/aide
+#pkg x                 restore_config /etc/issue.net
+#pkg x                 restore_config /etc/issue
+#pkg x                 restore_config /etc/pam.d/login
+pkg mrtg-cn                    pkgrm mrtg mrtg-cn      # zamjenjeno sa munin
 # konacno, instalacija novih paketa
+pkg amavisd-cn                 restore_amavis_init
+pkg apache-cn                  upgrade_apache
+pkg mrtg-cn                    pkgadd munin-cn
 true                           upgrade first           # neki paketi moraju rucno
 true                           upgrade second          # neke pakete zelimo ranije
 pkg freeradius-cn lt 2:1.0.1-2 install_freeradius      # neki su totalno poremeceni # fix 2.1.4
index cd2bc56..54e8903 100644 (file)
@@ -305,7 +305,7 @@ upgrade () {
 # funkcija utrpa ispravan sources.list
 create_sources_list () {
     [ -f /etc/apt/sources.list -a ! -f /etc/apt/sources.list.cn3-upgrade ] && mv /etc/apt/sources.list /etc/apt/sources.list.cn3-upgrade
-    cp /usr/share/carnet-upgrade/files/sources.list /etc/apt
+    cp /usr/share/carnet-upgrade/files/etc/apt/sources.list /etc/apt
     notice "Novi sadrzaj datoteke /etc/apt/sources.list:
 
 `cat /etc/apt/sources.list`"
@@ -334,7 +334,7 @@ add_group_proc () {
 
 # backup_slapd_db
 backup_slapd_db () {
-  local ldap_backup=/var/backup/slapcat.cn3-upgrade
+  local ldap_backup=/var/backups/slapcat.cn3-upgrade
 
   if [ ! -f $ldap_backup ]; then
     [ -x /etc/init.d/freeradius ] && /etc/init.d/freeradius stop || true
@@ -392,18 +392,18 @@ restore_config () {
 
   for file in "$@"; do
     # backup changes
-    if [ -f "$file" -a ! -f "$file.cn3-upgrade" ]; then
+    if [ -e "$file" -a ! -e "$file.cn3-upgrade" ]; then
       mv "$file" "$file.cn3-upgrade"
     fi
 
     # install original
-    cp "/usr/share/carnet/upgrade/files/$file" "$file"
+    cp "/usr/share/carnet-upgrade/files/$file" "$file"
   done
 }
 
 # upgrade apache -> apache2
-install_apache2 () {
-  # bugfix za apache2-cn postinst
+upgrade_apache () {
+  # bugfix for apache2-cn postinst
   mkdir -p /etc/apache2
   touch /etc/apache2/httpd.conf
 
@@ -411,6 +411,15 @@ install_apache2 () {
   pkgadd apache2 squirrelmail apache2-cn squirrelmail-cn
 }
 
+# restore amavis init script
+restore_amavis_init () {
+  # remove diversion
+  if [ -L /etc/init.d/amavis -a -f /etc/init.d/amavis.amavisd-new ]; then
+    rm -f /etc/init.d/amavis
+    dpkg-divert --remove --package amavis-cn --rename /etc/init.d/amavis --quiet
+  fi 
+}
+
 # instaliraj zadnji freeradius; uvjeti u queue fileovima
 install_freeradius () {
   pkgadd --force-yes freeradius-cn freeradius=1.0.5-0 freeradius-ldap=1.0.5-0