Double check rsyslog installation.
[carnet-upgrade.git] / src / functions.sh
index d9c9734..56fab41 100644 (file)
@@ -367,7 +367,7 @@ check_upgrade () {
 
   if [ "$upgrade" ]; then
     notice "
-Prije prelaska na Debian Squeeze potrebno je napraviti nadogradnju ovih paketa:
+Prije prelaska na Debian Wheezy potrebno je napraviti nadogradnju ovih paketa:
   $upgrade
 
 Pokrenite:
@@ -861,17 +861,12 @@ pkgupgrade () {
   fi
 }
 
-# make a silent upgrade to new libc6
-upgrade_libc () {
-  DEBIAN_FRONTEND=noninteractive pkgupgrade libc6 libc6-dev tzdata
-}
-
 # upgrade apache2/php5
 upgrade_apache2 () {
   pkgrm apache-common # prevents installation of apache2-suexec
   pkgrm php5-suhosin # not available for wheezy
   pkgupgrade libapache2-mod-php5 php5-cli php5-cn apache2-cn \
-    php5-odbc
+    php5-odbc mod-security-cn
 }
 
 upgrade_amavis () {
@@ -918,7 +913,15 @@ upgrade_postfix () {
 
 # upgrade the IMAP server
 upgrade_dovecot() {
-  if [ ! -f /etc/dovecot/conf.d/95-local ]; then
+  local local_conf=/etc/dovecot/conf.d/95-${backup_ext}.conf
+
+  if [ -f /etc/dovecot/conf.d/95-local -a ! -f $local_conf ]; then
+     mv /etc/dovecot/conf.d/95-local $local_conf
+     sed -i 's/\/usr\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf
+     /etc/init.d/dovecot restart
+  fi
+
+  if [ ! -f $local_conf ]; then
      pkgrm dovecot-cn
 
      # restore config
@@ -948,7 +951,8 @@ upgrade_dovecot() {
 
      # install new version and restore local changes
      pkgadd dovecot-core
-     doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > /etc/dovecot/conf.d/95-local
+     doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > $local_conf
+     sed -i 's/\/user\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf
 
      pkgadd dovecot-cn
   fi
@@ -985,7 +989,12 @@ upgrade_mailman() {
 upgrade_kernel() {
   if pkg kernel-2.6-cn; then
     pkgrm kernel-2.6-cn
-    pkgadd kernel-cn
+
+    if pkg grub-pc; then
+      pkgadd kernel-cn grub-pc
+    else
+      pkgadd kernel-cn
+    fi
   fi
 }
 
@@ -1000,6 +1009,17 @@ get_variable () {
   echo $val
 }
 
+# switch to rsyslog
+upgrade_syslog() {
+  # libc6-dev prevents upgrade
+  if pkg libc6-dev; then
+     pkgrm libc6-dev
+  fi
+
+  pkgadd rsyslog
+  dpkg -P sysklogd klogd
+}
+
 # restore munin configs for silent upgrade
 upgrade_munin () {
   local config backup hostname domain