Merge branch 'master' of git.oopen.de:install/mailsystem

This commit is contained in:
Christoph 2022-02-06 13:34:56 +01:00
commit dfae78d262

View File

@ -3071,6 +3071,41 @@ if $INSTALL_CLAMAV_UNOFFICIAL_SIGS ; then
[[ $OK = "yes" ]] || fatal "Abbruch durch User" [[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi fi
echononl " Check if working directory for 'urlhaus' will be created if not exists.."
_clamav_script="/usr/local/sbin/clamav-unofficial-sigs.sh"
if ! $(grep -q -E "^\s*xshok_mkdir_ownership\s+\"\\\$work_dir_urlhaus\"" "${_clamav_script}" 2> /dev/null) ; then
if $(grep -q -E "^\s*xshok_mkdir_ownership\s+\"\\\$work_dir\"" "${_clamav_script}" 2> /dev/null) ; then
perl -i -n -p \
-e "s#(\s*xshok_mkdir_ownership\s+)(\"\\\$work_dir\")#\1\2\n\1\"\\\$work_dir_urlhaus\"#" \
"${_clamav_script}" > $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
else
echo_skipped
fi
_create_dirs="/var/log/clamav-unofficial-sigs /etc/clamav-unofficial-sigs" _create_dirs="/var/log/clamav-unofficial-sigs /etc/clamav-unofficial-sigs"
for _create_dir in $_create_dirs ; do for _create_dir in $_create_dirs ; do
echononl " Create directory \"${_create_dir}\"" echononl " Create directory \"${_create_dir}\""
@ -3160,19 +3195,18 @@ if $INSTALL_CLAMAV_UNOFFICIAL_SIGS ; then
if [[ "${os_dist,,}" = "debian" ]] ; then if [[ "${os_dist,,}" = "debian" ]] ; then
if [[ "$os_version" = "8" ]] || [[ "$os_version" = "9" ]] || [[ "$os_version" = "10" ]] ; then
## - For Debian Jessie (Debian 8) // Stretch (Debian 9) // Buster (Debian 10) ## - For Debian Jessie (Debian 8) // Stretch (Debian 9) // Buster (Debian 10) // Bullseye (Debian 11)
## - ## -
_failed=false _failed=false
echononl " At directory /etc/clamav-unofficial-sigs copy os.debian${os_version}.conf to os.conf" echononl " At directory /etc/clamav-unofficial-sigs copy os.debian${os_version}.conf to os.conf"
if [[ ! -f /etc/clamav-unofficial-sigs/os.debian${os_version}.conf ]] ; then if [[ ! -f /etc/clamav-unofficial-sigs/os/os.debian${os_version}.conf ]] ; then
_tmp_version=$(expr $os_version - 1) _tmp_version=$(expr $os_version - 1)
if [[ -f "/etc/clamav-unofficial-sigs/os.debian${_tmp_version}.conf" ]] ; then if [[ -f "/etc/clamav-unofficial-sigs/os/os.debian${_tmp_version}.systemd.conf" ]] ; then
cp "/etc/clamav-unofficial-sigs/os.debian${_tmp_version}.conf" \ cp "/etc/clamav-unofficial-sigs/os/os.debian${_tmp_version}.systemd.conf" \
"/etc/clamav-unofficial-sigs/os.conf" > $tmp_err_msg 2>&1 "/etc/clamav-unofficial-sigs/os.conf" > $tmp_err_msg 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "File not found: /etc/clamav-unofficial-sigs/os.debian${os_version}.conf" > $tmp_err_msg echo "Error copying /etc/clamav-unofficial-sigs/os.debian${os_version}.systemd.conf" >> $tmp_err_msg
_failed=true _failed=true
fi fi
else else
@ -3187,7 +3221,7 @@ if $INSTALL_CLAMAV_UNOFFICIAL_SIGS ; then
fi fi
fi fi
else else
cp "/etc/clamav-unofficial-sigs/os.debian${os_version}.conf" \ cp "/etc/clamav-unofficial-sigs/os/os.debian${os_version}.conf" \
"/etc/clamav-unofficial-sigs/os.conf" > $tmp_err_msg 2>&1 "/etc/clamav-unofficial-sigs/os.conf" > $tmp_err_msg 2>&1
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
_failed=true _failed=true
@ -3290,9 +3324,11 @@ if $INSTALL_CLAMAV_UNOFFICIAL_SIGS ; then
if ! $installation_failed ; then if ! $installation_failed ; then
echo_ok echo_ok
fi fi
else else
error "Cannot create file 'os.conf' (No Debian Version detected).
See file /etc/clamav-unofficial-sigs/INSTALL.md to create it manually" error "Cannot create file 'os.conf' (No Linux Distribution detected)
See file /etc/clamav-unofficial-sigs/INSTALL to create it manually"
echononl "continue anyway [yes/no]: " echononl "continue anyway [yes/no]: "
read OK read OK
@ -3302,12 +3338,7 @@ if $INSTALL_CLAMAV_UNOFFICIAL_SIGS ; then
read OK read OK
done done
[[ $OK = "yes" ]] || fatal "Abbruch durch User" [[ $OK = "yes" ]] || fatal "Abbruch durch User"
fi
else
error "Cannot create file 'os.conf' (No Linux Distribution detected)
See file /etc/clamav-unofficial-sigs/INSTALL to create it manually"
fi # if [[ "${os_dist,,}" = "debian" ]] fi # if [[ "${os_dist,,}" = "debian" ]]
echononl " Adjust /etc/clamav-unofficial-sigs/user.conf" echononl " Adjust /etc/clamav-unofficial-sigs/user.conf"
@ -3450,7 +3481,11 @@ EOF
echo_ok echo_ok
else else
echo_failed echo_failed
error "$(cat $tmp_err_msg)" error "
$(cat $tmp_err_msg)
command was:
/usr/local/sbin/clamav-unofficial-sigs.sh --install-cron"
echononl "continue anyway [yes/no]: " echononl "continue anyway [yes/no]: "
read OK read OK
@ -3630,7 +3665,10 @@ for _module in $_needed_cpan_modules ; do
cpanm -q --skip-installed $_module > "$tmp_err_msg" 2>&1 cpanm -q --skip-installed $_module > "$tmp_err_msg" 2>&1
if [[ "$?" -ne 0 ]] ; then if [[ "$?" -ne 0 ]] ; then
installation_failed=true installation_failed=true
error "$(cat $tmp_err_msg)" error "$(cat $tmp_err_msg)
command was:
cpanm -q --skip-installed $_module"
echononl "continue anyway [yes/no]: " echononl "continue anyway [yes/no]: "
read OK read OK