From f802c969b4b7d7368fe6e8e286e7a133c68f550f Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Mon, 13 Jun 2011 20:24:51 +0200 Subject: [PATCH] Provjera postojanosti datoteka prije njihovog backupa. --- debian/changelog | 7 +++++++ debian/postinst | 12 ++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) 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` -- 1.7.10.4