From: Dragan Dosen Date: Mon, 13 Jun 2011 18:24:51 +0000 (+0200) Subject: Provjera postojanosti datoteka prije njihovog backupa. X-Git-Tag: v1%2.3.14+3^0 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=f802c969b4b7d7368fe6e8e286e7a133c68f550f;p=xinetd-cn.git Provjera postojanosti datoteka prije njihovog backupa. --- diff --git a/debian/changelog b/debian/changelog index aaf7760..a5aaaa0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +xinetd-cn (1:2.3.14+3) stable; urgency=low + + * Provjera postojanosti konfiguracijskih datoteka prije pokretanja + backup procedure za iste. + + -- Dragan Dosen Mon, 13 Jun 2011 20:23:51 +0200 + xinetd-cn (1:2.3.14+2) stable; urgency=low * Promjena e-mail adrese odrzavatelja paketa. diff --git a/debian/postinst b/debian/postinst index a39035e..f620ce5 100644 --- a/debian/postinst +++ b/debian/postinst @@ -67,11 +67,15 @@ trap cleanup 0 1 2 15 # First, we do backup (inetd, xinetd) # -if cp_backup_conffile -r -d $BACKUPDIR -p $INETDCONF; then - cp_echo "CN: Old $INETDCONF saved as $BACKUPDIR/`basename $INETDCONF`.bak." +if [ -f "$INETDCONF" ]; then + if cp_backup_conffile -r -d $BACKUPDIR -p $INETDCONF; then + cp_echo "CN: Old $INETDCONF saved as $BACKUPDIR/`basename $INETDCONF`.bak." + fi fi -if cp_backup_conffile -r -d $BACKUPDIR -p $CONF; then - cp_echo "CN: Old $CONF saved as $BACKUPDIR/`basename $CONF`.bak." +if [ -f "$CONF" ]; then + if cp_backup_conffile -r -d $BACKUPDIR -p $CONF; then + cp_echo "CN: Old $CONF saved as $BACKUPDIR/`basename $CONF`.bak." + fi fi CONFTMP=`mktemp $CONF.tmp.XXXXXX`