From 8b34b552baede1436287f0f535b0762a0c58a63f Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 25 Oct 2022 01:53:43 +0200 Subject: [PATCH] install_amavis.sh: backup directory '/etc/clamav-unofficial-sigs' if already exists. --- install_amavis.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/install_amavis.sh b/install_amavis.sh index 9a279ae..0a8a660 100755 --- a/install_amavis.sh +++ b/install_amavis.sh @@ -3105,6 +3105,28 @@ if $INSTALL_CLAMAV_UNOFFICIAL_SIGS ; then echo_skipped fi + echononl " Backup directory '/etc/clamav-unofficial-sigs' .." + if [[ -d "/etc/clamav-unofficial-sigs" ]]; then + mv "/etc/clamav-unofficial-sigs" "/etc/clamav-unofficial-sigs.BAK.${backup_date}" > $tmp_err_msg 2>&1 + if [[ $? -eq 0 ]] ; then + echo_ok + else + echo_failed + error "$(cat $tmp_err_msg)" + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/nno]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Abbruch durch User" + fi + else + echo_skipped + fi + _create_dirs="/var/log/clamav-unofficial-sigs /etc/clamav-unofficial-sigs" for _create_dir in $_create_dirs ; do