Lines 1-43
Link Here
|
1 |
--- clamav-unofficial-sigs.sh.orig 2016-11-18 10:05:40 UTC |
1 |
--- clamav-unofficial-sigs.sh.orig 2017-09-03 19:06:06 UTC |
2 |
+++ clamav-unofficial-sigs.sh |
2 |
+++ clamav-unofficial-sigs.sh |
3 |
@@ -753,6 +753,8 @@ function make_signature_database_from_as |
3 |
@@ -1290,7 +1290,7 @@ minimum_required_config_version="72" |
4 |
#Remove the clamav-unofficial-sigs script |
|
|
5 |
function remove_script () { |
6 |
echo "" |
7 |
+ pkg_mgr="FreeBSD ports" |
8 |
+ pkg_rm="pkg delete" |
9 |
if [ -n "$pkg_mgr" ] && [ -n "$pkg_rm" ] ; then |
10 |
echo "This script (clamav-unofficial-sigs) was installed on the system via '$pkg_mgr'" |
11 |
echo "use '$pkg_rm' to remove the script and all of its associated files and databases from the system." |
12 |
@@ -1151,7 +1153,7 @@ minimum_required_config_version="65" |
13 |
minimum_yara_clamav_version="0.99" |
4 |
minimum_yara_clamav_version="0.99" |
14 |
|
5 |
|
15 |
#default config files |
6 |
# Default config files |
16 |
-config_dir="/etc/clamav-unofficial-sigs" |
7 |
-config_dir="/etc/clamav-unofficial-sigs" |
17 |
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs" |
8 |
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs" |
18 |
config_files=("$config_dir/master.conf" "$config_dir/os.conf" "$config_dir/user.conf") |
9 |
config_files=( "$config_dir/master.conf" "$config_dir/os.conf" "$config_dir/user.conf" ) |
19 |
|
10 |
|
20 |
#Initialise |
11 |
# Initialise |
21 |
@@ -1879,20 +1881,11 @@ if [ "$sanesecurity_enabled" == "yes" ] |
12 |
@@ -2131,20 +2131,11 @@ if [ "$sanesecurity_enabled" == "yes" ] |
22 |
xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" |
13 |
xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" |
23 |
xshok_pretty_echo_and_log "Checking for Sanesecurity updates..." |
14 |
xshok_pretty_echo_and_log "Checking for Sanesecurity updates..." |
24 |
|
15 |
|
25 |
- sanesecurity_mirror_ips=$(dig +ignore +short "$sanesecurity_url") |
16 |
- sanesecurity_mirror_ips="$(dig +ignore +short "$sanesecurity_url")" |
26 |
- #add fallback to host if dig returns no records |
17 |
- # Add fallback to host if dig returns no records |
27 |
- if [ "$(xshok_array_count "$sanesecurity_mirror_ips")" -lt 1 ] ; then |
18 |
- if [ ${#sanesecurity_mirror_ips} -lt 1 ] ; then |
28 |
- sanesecurity_mirror_ips=$(host -t A "$sanesecurity_url" | sed -n '/has address/{s/.*address \([^ ]*\).*/\1/;p;}') |
19 |
- sanesecurity_mirror_ips="$(host -t A "$sanesecurity_url" | sed -n '/has address/{s/.*address \([^ ]*\).*/\1/;p;}')" |
29 |
- fi |
20 |
- fi |
30 |
+ sanesecurity_mirror_ips=$(host "$sanesecurity_url" | sed 's/.*[[:space:]]//') |
21 |
+ sanesecurity_mirror_ips=$(host "$sanesecurity_url" | sed 's/.*[[:space:]]//') |
31 |
|
22 |
|
32 |
if [ "$(xshok_array_count "$sanesecurity_mirror_ips")" -ge "1" ] ; then |
23 |
if [ ${#sanesecurity_mirror_ips} -ge 1 ] ; then |
33 |
for sanesecurity_mirror_ip in $sanesecurity_mirror_ips ; do |
24 |
for sanesecurity_mirror_ip in $sanesecurity_mirror_ips ; do |
34 |
- sanesecurity_mirror_name="" |
25 |
- sanesecurity_mirror_name="" |
35 |
- sanesecurity_mirror_name=$(dig +short -x "$sanesecurity_mirror_ip" | command sed 's/\.$//') |
26 |
- sanesecurity_mirror_name="$(dig +short -x "$sanesecurity_mirror_ip" | command sed 's/\.$//')" |
36 |
- #add fallback to host if dig returns no records |
27 |
- # Add fallback to host if dig returns no records |
37 |
- if [ "$sanesecurity_mirror_name" == "" ] ; then |
28 |
- if [ -z "$sanesecurity_mirror_name" ] ; then |
38 |
- sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed -n '/name pointer/{s/.*pointer \([^ ]*\).*\.$/\1/;p;}') |
29 |
- sanesecurity_mirror_name="$(host "$sanesecurity_mirror_ip" | sed -n '/name pointer/{s/.*pointer \([^ ]*\).*\.$/\1/;p;}')" |
39 |
- fi |
30 |
- fi |
40 |
+ sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed 's/.*[[:space:]]//' | sed 's/\.$//') |
31 |
+ sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed 's/.*[[:space:]]//' | sed 's/\.$//') |
41 |
sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" |
32 |
sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" |
42 |
xshok_pretty_echo_and_log "Sanesecurity mirror site used: $sanesecurity_mirror_site_info" |
33 |
xshok_pretty_echo_and_log "Sanesecurity mirror site used: $sanesecurity_mirror_site_info" |
43 |
$rsync_bin $rsync_output_level $no_motd --files-from="$sanesecurity_include_dbs" -ctuz $connect_timeout --timeout="$rsync_max_time" "rsync://$sanesecurity_mirror_ip/sanesecurity" "$work_dir_sanesecurity" 2>/dev/null |
34 |
# shellcheck disable=SC2086 |