From 570e937df828027940cd785af642e0b840808f21 Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 14 Aug 2024 11:53:49 +0000 Subject: [PATCH] Fix conf backup --- bashclub-zsync/DEBIAN/postrm | 2 +- bashclub-zsync/DEBIAN/preinst | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bashclub-zsync/DEBIAN/postrm b/bashclub-zsync/DEBIAN/postrm index 3b41462..b7c2705 100755 --- a/bashclub-zsync/DEBIAN/postrm +++ b/bashclub-zsync/DEBIAN/postrm @@ -1,5 +1,5 @@ #!/bin/bash -if [ -f /etc/bashclub/zsync.conf ]; then +if [ -f /etc/bashclub/zsync.conf ] && [ ! -f /etc/bashclub/zsync.conf.backup_$(date +%Y-%m-%d) ] ; then cp /etc/bashclub/zsync.conf /etc/bashclub/zsync.conf.backup_$(date +%Y-%m-%d) fi diff --git a/bashclub-zsync/DEBIAN/preinst b/bashclub-zsync/DEBIAN/preinst index 6972d2d..f45ef6e 100755 --- a/bashclub-zsync/DEBIAN/preinst +++ b/bashclub-zsync/DEBIAN/preinst @@ -9,4 +9,8 @@ if ! dpkg -l bashclub-zsync > /dev/null 2>&1; then mv ${zsync} ${zsync}.legacy chmod -x ${zsync}.legacy fi -fi \ No newline at end of file +fi + +if [ -f /etc/bashclub/zsync.conf ] && [ ! -f /etc/bashclub/zsync.conf.backup_$(date +%Y-%m-%d) ] ; then + cp /etc/bashclub/zsync.conf /etc/bashclub/zsync.conf.backup_$(date +%Y-%m-%d) +fi