From: Valentin Vidic Date: Mon, 14 Jan 2008 09:59:49 +0000 (+0100) Subject: Changed backup extension to cn4. X-Git-Tag: debian/4.0.1~72 X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=commitdiff_plain;h=62ba6e8cab796bedfe8a166bf56b393aa32fb398;p=carnet-upgrade.git Changed backup extension to cn4. --- diff --git a/src/functions.sh b/src/functions.sh index f98489a..9a89122 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -304,7 +304,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 + [ -f /etc/apt/sources.list -a ! -f /etc/apt/sources.list.cn4-upgrade ] && mv /etc/apt/sources.list /etc/apt/sources.list.cn4-upgrade cp /usr/share/carnet-upgrade/files/etc/apt/sources.list /etc/apt notice "Novi sadrzaj datoteke /etc/apt/sources.list: @@ -334,7 +334,7 @@ add_group_proc () { # backup_slapd_db backup_slapd_db () { - local ldap_backup=/var/backups/slapcat.cn3-upgrade + local ldap_backup=/var/backups/slapcat.cn4-upgrade if [ ! -f $ldap_backup ]; then [ -x /etc/init.d/freeradius ] && /etc/init.d/freeradius stop || true @@ -357,7 +357,7 @@ backup_slapd_db () { # backup etc direktorija backup_etc_dir () { - local etc_backup=/var/backups/etc.cn3-upgrade.tar.gz + local etc_backup=/var/backups/etc.cn4-upgrade.tar.gz if [ ! -f $etc_backup ]; then if tar cfz $etc_backup /etc 2> /dev/null; then @@ -373,15 +373,15 @@ backup_etc_dir () { # fixaj /etc/default/raid2 fix_etc_default_raid2 () { if [ -f /etc/default/raid2 ]; then - sed "s/^AUTOSTART.*/AUTOSTART=true/g" /etc/default/raid2 > /etc/default/raid2.cn3-upgrade.$$ - chown --reference=/etc/default/raid2 /etc/default/raid2.cn3-upgrade.$$ - chmod --reference=/etc/default/raid2 /etc/default/raid2.cn3-upgrade.$$ + sed "s/^AUTOSTART.*/AUTOSTART=true/g" /etc/default/raid2 > /etc/default/raid2.cn4-upgrade.$$ + chown --reference=/etc/default/raid2 /etc/default/raid2.cn4-upgrade.$$ + chmod --reference=/etc/default/raid2 /etc/default/raid2.cn4-upgrade.$$ - if ! cmp -s /etc/default/raid2.cn3-upgrade.$$ /etc/default/raid2; then + if ! cmp -s /etc/default/raid2.cn4-upgrade.$$ /etc/default/raid2; then log "Fixed /etc/default/raid2 AUTOSTART option." - mv /etc/default/raid2.cn3-upgrade.$$ /etc/default/raid2 + mv /etc/default/raid2.cn4-upgrade.$$ /etc/default/raid2 else - rm /etc/default/raid2.cn3-upgrade.$$ + rm /etc/default/raid2.cn4-upgrade.$$ fi fi } @@ -391,7 +391,7 @@ restore_config () { local file file_backup for file in "$@"; do - file_backup=$file.cn3-upgrade + file_backup=$file.cn4-upgrade if [ -e $file -a ! -e $file_backup ]; then # backup file mv $file $file_backup @@ -436,7 +436,7 @@ restore_configs () { # 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" + [ ! -e "$file.cn4-upgrade" ] && mv "$file" "$file.cn4-upgrade" rm -f "$file" done } @@ -483,8 +483,8 @@ upgrade_amavis () { # move old config aside local conf=/etc/amavis/amavisd.conf - if [ -e $conf -a ! -e $conf.cn3-upgrade ]; then - mv $conf $conf.cn3-upgrade + if [ -e $conf -a ! -e $conf.cn4-upgrade ]; then + mv $conf $conf.cn4-upgrade fi pkgadd amavisd-cn amavisd-new @@ -610,16 +610,16 @@ fix_smtp_auth() { fi if [ -f $conf -a -f $tmpl ] && \ ! cmp -s $conf $tmpl; then - mv $conf $conf.cn3-upgrade + mv $conf $conf.cn4-upgrade mv_in_sasl=1 fi if [ -f $confdir/Sendmail.conf ]; then - mv $confdir/Sendmail.conf $confdir/Sendmail.conf.cn3-upgrade + mv $confdir/Sendmail.conf $confdir/Sendmail.conf.cn4-upgrade mv_in_sasl=1 fi if [ -f $confdir/sasl.m4 ] && \ ! cmp -s $confdir/sasl.m4 $tmpldir/sasl.m4; then - mv -f $confdir/sasl.m4 $confdir/sasl.m4.cn3-upgrade + mv -f $confdir/sasl.m4 $confdir/sasl.m4.cn4-upgrade mv_in_sasl=1 fi [ "$mv_in_sasl" ] && \