X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=4620e8aad9dae98acf2dca2ed3127a2d05987ebc;hb=14762ba1a453a7d51c38d403b35055b1592e1376;hp=5369717a74ebecc1b95473a55dd7a1a0feb89ea4;hpb=aa9d45a18f480caa91f2127e34901f7b65af393b;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 5369717..4620e8a 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -467,7 +467,7 @@ check_grsec_kernel () { return 0 fi - if [ "$ver" = "${ver#2.6.2[4-9]}" ] || reboot_required; then + if [ "$ver" = "${ver#2.6.2[4-9]}" ]; then # kernel too old notice " Prije prelaska na Debian Lenny potrebno je napraviti nadogradnju na najnoviji kernel. @@ -483,6 +483,18 @@ Nakon toga ponovno pozovite ovu skriptu." fi } +check_reboot () { + reboot_required || return 0 + + LC_MESSAGES=hr_HR dialog --backtitle "$title" --yesno "$reboot_warning" 18 +75 + if [ $? -eq 0 ]; then + log "Reboot before continuing." + exit 0 + else + log "Proceed without reboot." + fi +} + # check if the latest kernel is booted reboot_required () { local default_kernel kernel_package running_release running_version @@ -970,7 +982,7 @@ upgrade_amavis () { # fix openldap-aai postinst user handling upgrade_openldap () { - pkg openldap-aai lt 2.3 || return 0 + pkg openldap-aai lt 2.4 || return 0 # openldap-aai expects org.ldif to exists local ldif=/var/lib/ldap/org.ldif @@ -1063,6 +1075,51 @@ upgrade_dovecot () { fi } +# restore munin configs for silent upgrade +upgrade_munin () { + local config backup hostname domain + + for pkg_name in munin munin-node; do + pkg $pkg_name lt '1.2.6-10~lenny1' || continue + + config=/etc/munin/$pkg_name.conf + backup=$config.$backup_ext + if [ -f $config -a ! -f $backup ]; then + hostname=$(hostname) + domain=$(hostname --domain) + + cp -av $config $backup + check_and_sed "$hostname.$domain" \ + "s/$hostname.$domain/localhost.localdomain/g" $config + fi + pkgadd $pkg_name + done + + # force localhost -> hostname replacement in config files + pkgadd munin-cn + dpkg-reconfigure munin-cn +} + +# udev.preinst fails if devfs configs still exist +upgrade_udev () { + local config + + for config in /etc/udev/rules.d/devfs.rules \ + /etc/udev/rules.d/compat-full.rules \ + /etc/udev/rules.d/compat.rules + do + if [ -e $config ]; then + mv -v $config /etc/udev/ + fi + done + + if [ -f /etc/udev/udev.rules -a ! -f /etc/udev/rules.d/udev.rules ]; then + ln -sfv ../udev.rules /etc/udev/rules.d/ + fi + + pkgadd udev +} + # fix /etc/dpkg/dpkg.cfg comment_force_overwrite () { if [ -f /etc/dpkg/dpkg.cfg ]; then