summaryrefslogtreecommitdiff
path: root/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh
blob: e8735f60f9a4082183114d98566c88311f2b56f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--- clamav-unofficial-sigs.sh.orig	2022-03-08 06:43:27 UTC
+++ clamav-unofficial-sigs.sh
@@ -1595,48 +1595,17 @@
 enable_log="no"
 custom_config="no"
 we_have_a_config="0"
+pkg_mgr="FreeBSD ports"
+pkg_rm="pkg delete"
 
-
-# Attempt to scan for a valid config dir
-if [ -f "/etc/clamav-unofficial-sigs/master.conf" ] ; then
-  config_dir="/etc/clamav-unofficial-sigs"
-elif [ -f "/usr/local/etc/clamav-unofficial-sigs/master.conf" ] ; then
-  config_dir="/usr/local/etc/clamav-unofficial-sigs/"
-elif [ -f "/opt/zimbra/conf/clamav-unofficial-sigs/master.conf" ] ; then
-  config_dir="/opt/zimbra/conf/clamav-unofficial-sigs/"
-else
-  xshok_pretty_echo_and_log "ERROR: config_dir (/etc/clamav-unofficial-sigs/master.conf) could not be found"
-  exit 1
-fi
 # Default config files
-if [ -r "${config_dir}/master.conf" ] ; then
-    config_files+=( "${config_dir}/master.conf" )
-else
-    xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not readable"
-    exit 1
-fi
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs"
+config_files=("${config_dir}/master.conf")
 if [ -r "${config_dir}/os.conf" ] ; then
     config_files+=( "${config_dir}/os.conf" )
-else
-    #find the a suitable os.*.conf file
-    os_config_number=$(find "$config_dir" -type f -iname "os.*.conf" | wc -l)
-    if [ "$os_config_number" == "0" ] ; then
-        xshok_pretty_echo_and_log "WARNING: no os.conf or os.*.conf found"
-    elif [ "$os_config_number" == "1" ] ; then
-        config_file="$(find "$config_dir" -type f -iname "os.*.conf" | head -n1)"
-        if [ -r "${config_file}" ]; then
-            config_files+=( "${config_file}" )
-        else
-            xshok_pretty_echo_and_log "WARNING: ${config_file} is not readable"
-        fi
-    else
-        xshok_pretty_echo_and_log "WARNING: Too many os.*.conf configs found"
-    fi
 fi
 if [ -r "${config_dir}/user.conf" ] ; then
     config_files+=( "${config_dir}/user.conf" )
-else
-    xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf is not readable"
 fi
 
 # Solaris command -v function returns garbage when the program is not found k
@@ -1762,10 +1731,8 @@
         else
             xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found"
         fi
-        #find the a suitable os.conf or os.*.conf file
-        config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)"
-        if [ -r "${config_file}" ] ; then
-            config_files+=( "${config_file}" )
+        if [ -r "${config_dir}/os.conf" ] ; then
+            config_files+=( "${config_dir}/os.conf" )
         else
             xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found"
         fi