X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=4c9860867856ab4f531d29f58de8fa28d735d20b;hb=2a7b2e0a1cfbe09be91af61f2938199a4b6591e9;hp=1d94faad309148b180f3a7a019f04f98504a2902;hpb=2374b9f2836bdf58e4a82cdd993a0a6b23e5be85;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 1d94faa..4c98608 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -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 jessie potrebno je napraviti nadogradnju ovih paketa: $upgrade Pokrenite: @@ -530,16 +530,18 @@ create_sources_list () { # backup old version if [ -f $sl -a ! -f $sl.$backup_ext ]; then - cp -av $sl $sl.$backup_ext + cp -v $sl $sl.$backup_ext fi # install new version - cp -av $sl_new $sl + cp -v $sl_new $sl notice "Novi sadrzaj datoteke /etc/apt/sources.list: `cat /etc/apt/sources.list`" fi + # make sure permissions are correct + chmod 0644 $sl rm $sl_new } @@ -744,6 +746,11 @@ restore_configs () { fi } +# load various debconf defaults +debconf_preload () { + echo libc6 libraries/restart-without-asking boolean true | debconf-set-selections +} + # temporary disable listchanges packages to reduce clutter during upgrade apt_listchanges () { local file command=$1 @@ -861,17 +868,11 @@ 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 +919,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 +957,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 @@ -1005,6 +1015,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