Merge branch 'master' of git.oopen.de:install/mailsystem
This commit is contained in:
commit
dfae78d262
@ -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,154 +3195,150 @@ 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
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
echo "Error copying /etc/clamav-unofficial-sigs/os.debian${os_version}.systemd.conf" >> $tmp_err_msg
|
||||||
|
_failed=true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ -f "/etc/clamav-unofficial-sigs/os/os.debian.conf" ]] ; then
|
||||||
|
cp "/etc/clamav-unofficial-sigs/os/os.debian.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
|
|
||||||
_failed=true
|
_failed=true
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ -f "/etc/clamav-unofficial-sigs/os/os.debian.conf" ]] ; then
|
|
||||||
cp "/etc/clamav-unofficial-sigs/os/os.debian.conf" \
|
|
||||||
"/etc/clamav-unofficial-sigs/os.conf" > $tmp_err_msg 2>&1
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
_failed=true
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
_failed=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
cp "/etc/clamav-unofficial-sigs/os.debian${os_version}.conf" \
|
|
||||||
"/etc/clamav-unofficial-sigs/os.conf" > $tmp_err_msg 2>&1
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
_failed=true
|
_failed=true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if ! $_failed ; then
|
else
|
||||||
echo_ok
|
cp "/etc/clamav-unofficial-sigs/os/os.debian${os_version}.conf" \
|
||||||
else
|
"/etc/clamav-unofficial-sigs/os.conf" > $tmp_err_msg 2>&1
|
||||||
echo_failed
|
if [[ $? -ne 0 ]]; then
|
||||||
error "$(cat $tmp_err_msg)"
|
_failed=true
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
## - Edit /etc/clamav-unofficial-sigs/os.conf and make changes if needed
|
|
||||||
## -
|
|
||||||
## - Maybe the following changes are needed:
|
|
||||||
## - clam_user="clamav"
|
|
||||||
## - clam_group="clamav"
|
|
||||||
## -
|
|
||||||
## - clamd_pid="/var/run/clamav/clamd.pid"
|
|
||||||
## -
|
|
||||||
## - clamd_restart_opt="systemctl restart clamav-daemon"
|
|
||||||
## - clamd_reload_opt="systemctl reload clamav-daemon"
|
|
||||||
## - or if debian 7
|
|
||||||
## - clamd_restart_opt="service clamav-daemon restart"
|
|
||||||
## - clamd_reload_opt="service clamav-daemon reload"
|
|
||||||
## -
|
|
||||||
## - clamd_socket="/var/run/clamav/clamd.ctl"
|
|
||||||
## -
|
|
||||||
echononl " Adjust /etc/clamav-unofficial-sigs/os.conf"
|
|
||||||
installation_failed=false
|
|
||||||
perl -i -n -p -e "s#^([ ]*\ *)(clam_user=.*)#\#\#\1\2\nclam_user=\"clamav\"#" \
|
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
|
||||||
if [[ "$?" -ne 0 ]] ; then
|
|
||||||
installation_failed=true
|
|
||||||
error "$(cat $tmp_err_msg)"
|
|
||||||
fi
|
|
||||||
perl -i -n -p -e "s#^([ ]*\ *)(clam_group=.*)#\#\#\1\2\nclam_group=\"clamav\"#" \
|
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
|
||||||
if [[ "$?" -ne 0 ]] ; then
|
|
||||||
installation_failed=true
|
|
||||||
error "$(cat $tmp_err_msg)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${os_dist,,}" = "debian" ]] && [[ "$os_version" -ge 10 ]]; then
|
|
||||||
perl -i -n -p -e "s#^([ ]*\ *)(clamd_pid=.*)#\#\#\1\2\nclamd_pid=\"/run/clamav/clamd.pid\"#" \
|
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
|
||||||
else
|
|
||||||
perl -i -n -p -e "s#^([ ]*\ *)(clamd_pid=.*)#\#\#\1\2\nclamd_pid=\"/var/run/clamav/clamd.pid\"#" \
|
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
|
||||||
fi
|
fi
|
||||||
if [[ "$?" -ne 0 ]] ; then
|
fi
|
||||||
installation_failed=true
|
if ! $_failed ; then
|
||||||
error "$(cat $tmp_err_msg)"
|
echo_ok
|
||||||
fi
|
else
|
||||||
|
echo_failed
|
||||||
|
error "$(cat $tmp_err_msg)"
|
||||||
|
|
||||||
if $systemd_exists ; then
|
echononl "continue anyway [yes/no]: "
|
||||||
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_restart_opt=.*)#\#\#\1\2\nclamd_restart_opt=\"systemctl restart clamav-daemon\"\nclamd_reload_opt=\"systemctl reload clamav-daemon\"#" \
|
read OK
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||||
if [[ "$?" -ne 0 ]] ; then
|
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||||
installation_failed=true
|
echononl "Wrong entry! - repeat [yes/nno]: "
|
||||||
error "$(cat $tmp_err_msg)"
|
read OK
|
||||||
fi
|
done
|
||||||
else
|
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
||||||
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_restart_opt=.*)#\#\#\1\2\nclamd_restart_opt=\"service clamav-daemon restart\"\nclamd_reload_opt=\"service clamav-daemon reload\"#" \
|
fi
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
|
||||||
if [[ "$?" -ne 0 ]] ; then
|
## - Edit /etc/clamav-unofficial-sigs/os.conf and make changes if needed
|
||||||
installation_failed=true
|
## -
|
||||||
error "$(cat $tmp_err_msg)"
|
## - Maybe the following changes are needed:
|
||||||
fi
|
## - clam_user="clamav"
|
||||||
fi
|
## - clam_group="clamav"
|
||||||
if [[ "${os_dist,,}" = "debian" ]] && [[ "$os_version" -ge 10 ]]; then
|
## -
|
||||||
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_socket=.*)#\#\#\1\2\nclamd_socket=\"/run/clamav/clamd.ctl\"#" \
|
## - clamd_pid="/var/run/clamav/clamd.pid"
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
## -
|
||||||
else
|
## - clamd_restart_opt="systemctl restart clamav-daemon"
|
||||||
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_socket=.*)#\#\#\1\2\nclamd_socket=\"/var/run/clamav/clamd.ctl\"#" \
|
## - clamd_reload_opt="systemctl reload clamav-daemon"
|
||||||
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
## - or if debian 7
|
||||||
|
## - clamd_restart_opt="service clamav-daemon restart"
|
||||||
|
## - clamd_reload_opt="service clamav-daemon reload"
|
||||||
|
## -
|
||||||
|
## - clamd_socket="/var/run/clamav/clamd.ctl"
|
||||||
|
## -
|
||||||
|
echononl " Adjust /etc/clamav-unofficial-sigs/os.conf"
|
||||||
|
installation_failed=false
|
||||||
|
perl -i -n -p -e "s#^([ ]*\ *)(clam_user=.*)#\#\#\1\2\nclam_user=\"clamav\"#" \
|
||||||
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
if [[ "$?" -ne 0 ]] ; then
|
||||||
|
installation_failed=true
|
||||||
|
error "$(cat $tmp_err_msg)"
|
||||||
|
fi
|
||||||
|
perl -i -n -p -e "s#^([ ]*\ *)(clam_group=.*)#\#\#\1\2\nclam_group=\"clamav\"#" \
|
||||||
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
if [[ "$?" -ne 0 ]] ; then
|
||||||
|
installation_failed=true
|
||||||
|
error "$(cat $tmp_err_msg)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${os_dist,,}" = "debian" ]] && [[ "$os_version" -ge 10 ]]; then
|
||||||
|
perl -i -n -p -e "s#^([ ]*\ *)(clamd_pid=.*)#\#\#\1\2\nclamd_pid=\"/run/clamav/clamd.pid\"#" \
|
||||||
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
else
|
||||||
|
perl -i -n -p -e "s#^([ ]*\ *)(clamd_pid=.*)#\#\#\1\2\nclamd_pid=\"/var/run/clamav/clamd.pid\"#" \
|
||||||
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
fi
|
||||||
|
if [[ "$?" -ne 0 ]] ; then
|
||||||
|
installation_failed=true
|
||||||
|
error "$(cat $tmp_err_msg)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $systemd_exists ; then
|
||||||
|
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_restart_opt=.*)#\#\#\1\2\nclamd_restart_opt=\"systemctl restart clamav-daemon\"\nclamd_reload_opt=\"systemctl reload clamav-daemon\"#" \
|
||||||
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
if [[ "$?" -ne 0 ]] ; then
|
||||||
|
installation_failed=true
|
||||||
|
error "$(cat $tmp_err_msg)"
|
||||||
fi
|
fi
|
||||||
if [[ "$?" -ne 0 ]] ; then
|
else
|
||||||
installation_failed=true
|
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_restart_opt=.*)#\#\#\1\2\nclamd_restart_opt=\"service clamav-daemon restart\"\nclamd_reload_opt=\"service clamav-daemon reload\"#" \
|
||||||
error "$(cat $tmp_err_msg)"
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
if [[ "$?" -ne 0 ]] ; then
|
||||||
|
installation_failed=true
|
||||||
|
error "$(cat $tmp_err_msg)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ "${os_dist,,}" = "debian" ]] && [[ "$os_version" -ge 10 ]]; then
|
||||||
|
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_socket=.*)#\#\#\1\2\nclamd_socket=\"/run/clamav/clamd.ctl\"#" \
|
||||||
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
else
|
||||||
|
perl -i -n -p -e "s#^([ ]*\#?\ *)(clamd_socket=.*)#\#\#\1\2\nclamd_socket=\"/var/run/clamav/clamd.ctl\"#" \
|
||||||
|
/etc/clamav-unofficial-sigs/os.conf > $tmp_err_msg 2>&1
|
||||||
|
fi
|
||||||
|
if [[ "$?" -ne 0 ]] ; then
|
||||||
|
installation_failed=true
|
||||||
|
error "$(cat $tmp_err_msg)"
|
||||||
|
|
||||||
echononl "continue anyway [yes/no]: "
|
echononl "continue anyway [yes/no]: "
|
||||||
read OK
|
read OK
|
||||||
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||||
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||||
echononl "Wrong entry! - repeat [yes/nno]: "
|
echononl "Wrong entry! - repeat [yes/nno]: "
|
||||||
read OK
|
read OK
|
||||||
done
|
done
|
||||||
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
||||||
fi
|
fi
|
||||||
if ! $installation_failed ; then
|
if ! $installation_failed ; then
|
||||||
echo_ok
|
echo_ok
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
error "Cannot create file 'os.conf' (No Debian Version detected).
|
|
||||||
See file /etc/clamav-unofficial-sigs/INSTALL.md to create it manually"
|
|
||||||
|
|
||||||
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
|
else
|
||||||
|
|
||||||
error "Cannot create file 'os.conf' (No Linux Distribution detected)
|
error "Cannot create file 'os.conf' (No Linux Distribution detected)
|
||||||
See file /etc/clamav-unofficial-sigs/INSTALL to create it manually"
|
See file /etc/clamav-unofficial-sigs/INSTALL to create it manually"
|
||||||
|
|
||||||
|
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 # 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
|
||||||
|
Loading…
Reference in New Issue
Block a user