X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=usr%2Fshare%2Fcarnet-upgrade%2Ffunctions.sh;h=16f3d2306f5c89d3e0af48a23849a30a1aed0140;hb=5d929e88076c0d1e268525b609aead29b8a6eb00;hp=cd2bc5687397e7112cf48a17f56a8dd3e4d96cc8;hpb=85b5bef2270edd34cee1ef836d4bbe6d298fc442;p=carnet-upgrade.git diff --git a/usr/share/carnet-upgrade/functions.sh b/usr/share/carnet-upgrade/functions.sh index cd2bc56..16f3d23 100644 --- a/usr/share/carnet-upgrade/functions.sh +++ b/usr/share/carnet-upgrade/functions.sh @@ -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 @@ -391,24 +391,124 @@ restore_config () { local file for file in "$@"; do - # backup changes - if [ -f "$file" -a ! -f "$file.cn3-upgrade" ]; then - mv "$file" "$file.cn3-upgrade" + if [ -e "$file" ]; then + # backup changes + [ ! -e "$file.cn3-upgrade" ] && mv "$file" "$file.cn3-upgrade" + + # install original + cp "/usr/share/carnet-upgrade/files/$file" "$file" fi + done +} - # install original - cp "/usr/share/carnet/upgrade/files/$file" "$file" +# restore modified config to their package defaults +# so the upgrade doesn't complain so much +restore_configs () { + restore_config /etc/bind/named.conf.options + restore_config /etc/default/ntpdate + restore_config /etc/default/oidentd + restore_config /etc/default/postgrey + restore_config /etc/default/saslauthd + restore_config /etc/default/slapd + restore_config /etc/dovecot/dovecot.conf + restore_config /etc/init.d/mysql + restore_config /etc/init.d/slapd + restore_config /etc/issue + restore_config /etc/issue.net + restore_config /etc/logrotate.d/mysql-server + restore_config /etc/mysql/my.cnf + restore_config /etc/ntp.conf + restore_config /etc/pam.d/login + restore_config /etc/php4/apache/php.ini + restore_config /etc/php4/cgi/php.ini + restore_config /etc/php4/cli/php.ini + restore_config /etc/postgrey/whitelist_clients + restore_config /etc/security/limits.conf + restore_config /etc/squirrelmail/apache.conf + restore_config /etc/sysctl.conf + restore_config /etc/vsftpd.conf + restore_config /etc/xinetd.conf + + # orphaned config file - no owner + rm -f /etc/logcheck/ignore.d.server/imap + + # aide switched to ucf, move old configs aside + for file in /etc/aide/aide.conf /etc/cron.daily/aide /etc/default/aide; do + [ ! -e "$file.cn3-upgrade" ] && mv "$file" "$file.cn3-upgrade" + rm -f "$file" done } +# make a silent installation of carnet and srce keyrings +install_keyrings () { + pkgadd carnet-keyring srce-keyring + pkgadd dpkg apt + + dpkg-reconfigure carnet-keyring srce-keyring + update +} + +# make a silent upgrade to new libc6 +upgrade_libc () { + DEBIAN_FRONTEND=noninteractive pkgadd libc6 +} + # 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 pkgadd php4-odbc php4-xslt mktemp - pkgadd apache2 squirrelmail apache2-cn squirrelmail-cn + + # apache2 conflicts with these + pkgrm apache aosi-aai aosi-www-aai php4-cn squirrelmail-cn + + # apache2-cn postinst needs new mktemp + pkgadd apache2-cn php5-cn aosi-aai aosi-www-aai # squirrelmail-cn +} + +upgrade_amavis () { + # 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 --quiet --remove /etc/init.d/amavis + fi + + # move old config aside + local conf=/etc/amavis/amavisd.conf + if [ -e $conf -a ! -e $conf.cn3-upgrade ]; then + mv $conf $conf.cn3-upgrade + fi + + pkgadd amavisd-cn amavisd-new +} + +# fix openldap-aai postinst user handling +upgrade_openldap () { + apt-get -y$s install openldap-aai || true + chown -R openldap:openldap /var/lib/ldap + /etc/init.d/slapd restart + dpkg --configure -a +} + +# workaround postfix-cn dependencies +upgrade_postfix () { + pkgadd sasl2-bin + pkgadd postfix postfix-cn +} + +# workaround dovecot-cn dependencies +upgrade_dovecot () { + pkgadd dovecot-imapd dovecot-pop3d + pkgadd dovecot-cn +} + +# workaround ntp-cn dependencies +upgrade_ntp () { + pkgadd ntp ntpdate + # pkgrm ntp-server + pkgadd ntp-cn } # instaliraj zadnji freeradius; uvjeti u queue fileovima @@ -464,11 +564,11 @@ fix_aidexfer_conf() { fix_issue () { cat > /etc/issue < /etc/issue.net <