install_amavis.sh: backup directory '/etc/clamav-unofficial-sigs' if already exists.

This commit is contained in:
Christoph 2022-10-25 01:53:43 +02:00
parent 9fdecd8783
commit 8b34b552ba

View File

@ -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