Lines 1-37
Link Here
|
1 |
--- clamav-unofficial-sigs.sh.orig 2019-09-02 22:41:48 UTC |
1 |
--- clamav-unofficial-sigs.sh.orig 2020-01-25 12:02:06 UTC |
2 |
+++ clamav-unofficial-sigs.sh |
2 |
+++ clamav-unofficial-sigs.sh |
3 |
@@ -1422,25 +1422,14 @@ force_wget="no" |
3 |
@@ -1541,26 +1541,10 @@ force_wget="no" |
4 |
enable_log="no" |
4 |
enable_log="no" |
5 |
custom_config="no" |
5 |
custom_config="no" |
6 |
we_have_a_config="0" |
6 |
we_have_a_config="0" |
7 |
+pkg_mgr="FreeBSD ports" |
7 |
+pkg_mgr="FreeBSD ports" |
8 |
+pkg_rm="pkg delete" |
8 |
+pkg_rm="pkg delete" |
9 |
|
9 |
|
10 |
- |
10 |
|
11 |
-# Attempt to scan for a valid config dir |
11 |
-# Attempt to scan for a valid config dir |
12 |
-if [ -f "/etc/clamav-unofficial-sigs/master.conf" ] ; then |
12 |
-if [ -f "/etc/clamav-unofficial-sigs/master.conf" ] ; then |
13 |
- config_dir="/etc/clamav-unofficial-sigs" |
13 |
- config_dir="/etc/clamav-unofficial-sigs" |
14 |
-elif [ -f "/usr/local/etc/clamav-unofficial-sigs/master.conf" ] ; then |
14 |
-elif [ -f "/usr/local/etc/clamav-unofficial-sigs/master.conf" ] ; then |
15 |
- config_dir="/usr/local/etc/clamav-unofficial-sigs/" |
15 |
- config_dir="/usr/local/etc/clamav-unofficial-sigs/" |
16 |
-elif [ -f "/opt/zimbra/config/clamav-unofficial-sigs/master.conf" ] ; then |
16 |
-elif [ -f "/opt/zimbra/conf/clamav-unofficial-sigs/master.conf" ] ; then |
17 |
- config_dir="/opt/zimbra/config/clamav-unofficial-sigs/" |
17 |
- config_dir="/opt/zimbra/conf/clamav-unofficial-sigs/" |
18 |
-else |
18 |
-else |
19 |
- xshok_pretty_echo_and_log "ERROR: config_dir (/etc/clamav-unofficial-sigs/master.conf) could not be found" |
19 |
- xshok_pretty_echo_and_log "ERROR: config_dir (/etc/clamav-unofficial-sigs/master.conf) could not be found" |
20 |
- exit 1 |
20 |
- exit 1 |
21 |
-fi |
21 |
-fi |
22 |
# Default config files |
22 |
-# Default config files |
23 |
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs" |
23 |
-if [ -r "${config_dir}/master.conf" ] ; then |
24 |
config_files=("${config_dir}/master.conf") |
24 |
- config_files+=( "${config_dir}/master.conf" ) |
25 |
-#find the a suitable os.conf or os.*.conf file |
25 |
-else |
26 |
-config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)" |
26 |
- xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not readable" |
27 |
-if [ -r "${config_file}" ]; then |
27 |
- exit 1 |
28 |
- config_files+=( "${config_file}" ) |
28 |
-fi |
29 |
+if [ -r "${config_dir}/os.conf" ] ; then |
29 |
if [ -r "${config_dir}/os.conf" ] ; then |
30 |
+ config_files+=( "${config_dir}/os.conf" ) |
30 |
config_files+=( "${config_dir}/os.conf" ) |
31 |
fi |
31 |
else |
32 |
if [ -r "${config_dir}/user.conf" ] ; then |
32 |
@@ -1718,10 +1702,8 @@ if [ "$custom_config" != "no" ] ; then |
33 |
config_files+=( "${config_dir}/user.conf" ) |
|
|
34 |
@@ -1576,10 +1565,8 @@ if [ "$custom_config" != "no" ] ; then |
35 |
else |
33 |
else |
36 |
xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found" |
34 |
xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found" |
37 |
fi |
35 |
fi |
Lines 44-50
Link Here
|
44 |
else |
42 |
else |
45 |
xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found" |
43 |
xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found" |
46 |
fi |
44 |
fi |
47 |
@@ -1625,7 +1612,7 @@ for config_file in "${config_files[@]}" ; do |
45 |
@@ -1767,7 +1749,7 @@ for config_file in "${config_files[@]}" ; do |
48 |
# Delete both trailing and leading whitespace |
46 |
# Delete both trailing and leading whitespace |
49 |
# Delete all trailing whitespace |
47 |
# Delete all trailing whitespace |
50 |
# Delete all empty lines |
48 |
# Delete all empty lines |
Lines 53-59
Link Here
|
53 |
fi |
51 |
fi |
54 |
|
52 |
|
55 |
#fix eval of | |
53 |
#fix eval of | |
56 |
@@ -1640,7 +1627,7 @@ for config_file in "${config_files[@]}" ; do |
54 |
@@ -1782,7 +1764,7 @@ for config_file in "${config_files[@]}" ; do |
57 |
fi |
55 |
fi |
58 |
|
56 |
|
59 |
# Check there is an = for every set of "" optional whitespace \s* between = and " |
57 |
# Check there is an = for every set of "" optional whitespace \s* between = and " |
Lines 62-68
Link Here
|
62 |
|
60 |
|
63 |
if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then |
61 |
if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then |
64 |
xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\"" |
62 |
xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\"" |
65 |
@@ -2316,24 +2303,12 @@ if [ "$sanesecurity_enabled" == "yes" ] ; then |
63 |
@@ -2504,24 +2486,12 @@ if [ "$sanesecurity_enabled" == "yes" ] ; then |
66 |
echo "$current_time" > "${work_dir_work_configs}/last-ss-update.txt" |
64 |
echo "$current_time" > "${work_dir_work_configs}/last-ss-update.txt" |
67 |
xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" |
65 |
xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" |
68 |
xshok_pretty_echo_and_log "Checking for Sanesecurity updates..." |
66 |
xshok_pretty_echo_and_log "Checking for Sanesecurity updates..." |
Lines 90-92
Link Here
|
90 |
sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" |
88 |
sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" |
91 |
xshok_pretty_echo_and_log "Sanesecurity mirror site used: ${sanesecurity_mirror_site_info}" |
89 |
xshok_pretty_echo_and_log "Sanesecurity mirror site used: ${sanesecurity_mirror_site_info}" |
92 |
# shellcheck disable=SC2086 |
90 |
# shellcheck disable=SC2086 |
|
|
91 |
@@ -2834,7 +2804,7 @@ if [ "$linuxmalwaredetect_enabled" == "yes" ] ; then |
92 |
ret="$?" |
93 |
if [ "$ret" -eq 0 ] ; then |
94 |
# shellcheck disable=SC2035 |
95 |
- $tar_bin --strip-components=1 --wildcards --overwrite -xzf "${work_dir_linuxmalwaredetect}/sigpack.tgz" --directory "${work_dir_linuxmalwaredetect}" */rfxn.* |
96 |
+ $tar_bin --strip-components=1 -xzf "${work_dir_linuxmalwaredetect}/sigpack.tgz" --directory "${work_dir_linuxmalwaredetect}" "*/rfxn.*" |
97 |
for db_file in "${linuxmalwaredetect_dbs[@]}" ; do |
98 |
if [ "$loop" == "1" ] ; then |
99 |
xshok_pretty_echo_and_log "---" |