Lines 1-45
Link Here
|
1 |
--- clamav-unofficial-sigs.sh.orig 2016-04-02 05:47:26 UTC |
1 |
--- clamav-unofficial-sigs.sh.orig 2016-05-23 23:38:56 UTC |
2 |
+++ clamav-unofficial-sigs.sh |
2 |
+++ clamav-unofficial-sigs.sh |
3 |
@@ -187,7 +187,7 @@ script_version_date="02 April 2016" |
3 |
@@ -1151,7 +1151,7 @@ minimum_required_config_version="65" |
4 |
minimum_required_config_version="56" |
4 |
minimum_yara_clamav_version="0.99" |
5 |
|
5 |
|
6 |
#default config files |
6 |
#default config files |
7 |
-config_dir="/etc/clamav-unofficial-sigs" |
7 |
-config_dir="/etc/clamav-unofficial-sigs" |
8 |
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs" |
8 |
+config_dir="/usr/local/etc/clamav-unofficial-sigs" |
9 |
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") |
10 |
|
10 |
|
11 |
#Initialise |
11 |
#Initialise |
12 |
@@ -627,6 +627,8 @@ make_signature_database_from_ascii_file |
12 |
@@ -1879,20 +1879,11 @@ if [ "$sanesecurity_enabled" == "yes" ] |
13 |
#Remove the clamav-unofficial-sigs script |
13 |
xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" |
14 |
remove_script () { |
14 |
xshok_pretty_echo_and_log "Checking for Sanesecurity updates..." |
15 |
echo "" |
15 |
|
16 |
+ pkg_mgr="FreeBSD ports" |
16 |
- sanesecurity_mirror_ips=$(dig +ignore +short "$sanesecurity_url") |
17 |
+ pkg_rm="pkg delete" |
17 |
- #add fallback to host if dig returns no records |
18 |
if [ -n "$pkg_mgr" -a -n "$pkg_rm" ] ; then |
18 |
- if [ "$(xshok_array_count "$sanesecurity_mirror_ips")" -lt 1 ] ; then |
19 |
echo " This script (clamav-unofficial-sigs) was installed on the system" |
19 |
- sanesecurity_mirror_ips=$(host -t A "$sanesecurity_url" | sed -n '/has address/{s/.*address \([^ ]*\).*/\1/;p;}') |
20 |
echo " via '$pkg_mgr', use '$pkg_rm' to remove the script" |
20 |
- fi |
21 |
@@ -1175,22 +1177,13 @@ if [ "$sanesecurity_enabled" == "yes" ] |
21 |
+ sanesecurity_mirror_ips=`host $sanesecurity_url | sed 's/.*\s//'` |
22 |
db_file="" |
22 |
|
23 |
xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" |
23 |
if [ "$(xshok_array_count "$sanesecurity_mirror_ips")" -ge "1" ] ; then |
24 |
|
24 |
for sanesecurity_mirror_ip in $sanesecurity_mirror_ips ; do |
25 |
- sanesecurity_mirror_ips=`dig +ignore +short $sanesecurity_url` |
25 |
- sanesecurity_mirror_name="" |
26 |
- #add fallback to host if dig returns no records |
26 |
- sanesecurity_mirror_name=$(dig +short -x "$sanesecurity_mirror_ip" | command sed 's/\.$//') |
27 |
- if [ `xshok_array_count "$sanesecurity_mirror_ips"` -lt 1 ] ; then |
27 |
- #add fallback to host if dig returns no records |
28 |
- sanesecurity_mirror_ips=`host -t A "$sanesecurity_url" | sed -n '/has address/{s/.*address \([^ ]*\).*/\1/;p}'` |
28 |
- if [ "$sanesecurity_mirror_name" == "" ] ; then |
29 |
- fi |
29 |
- sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed -n '/name pointer/{s/.*pointer \([^ ]*\).*\.$/\1/;p;}') |
30 |
+ sanesecurity_mirror_ips=`host $sanesecurity_url | sed 's/.*\s//'` |
30 |
- fi |
31 |
|
31 |
+ sanesecurity_mirror_name=`host $sanesecurity_mirror_ip | sed 's/.*\s//' | sed 's/\.$//'` |
32 |
if [ `xshok_array_count "$sanesecurity_mirror_ips"` -ge "1" ] ; then |
32 |
sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" |
33 |
|
33 |
xshok_pretty_echo_and_log "Sanesecurity mirror site used: $sanesecurity_mirror_site_info" |
34 |
|
34 |
$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 |
35 |
for sanesecurity_mirror_ip in $sanesecurity_mirror_ips ; do |
|
|
36 |
- sanesecurity_mirror_name="" |
37 |
- sanesecurity_mirror_name=`dig +short -x $sanesecurity_mirror_ip | command sed 's/\.$//'` |
38 |
- #add fallback to host if dig returns no records |
39 |
- if [ "$sanesecurity_mirror_name" == "" ] ; then |
40 |
- sanesecurity_mirror_name=`host "$sanesecurity_mirror_ip" | sed -n '/name pointer/{s/.*pointer \([^ ]*\).*/\1/;p}'` |
41 |
- fi |
42 |
+ sanesecurity_mirror_name=`host $sanesecurity_mirror_ip | sed 's/.*\s//' | sed 's/\.$//'` |
43 |
sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" |
44 |
xshok_pretty_echo_and_log "Sanesecurity mirror site used: $sanesecurity_mirror_site_info" |
45 |
$rsync_bin $rsync_output_level $no_motd --files-from=$sanesecurity_include_dbs -ctuz $connect_timeout --timeout="$rsync_max_time" --stats rsync://$sanesecurity_mirror_ip/sanesecurity $sanesecurity_dir 2>/dev/null |