Lines 10-23
Link Here
|
10 |
provide antivirus |
10 |
provide antivirus |
11 |
} |
11 |
} |
12 |
|
12 |
|
13 |
start() { |
13 |
get_config() { |
14 |
local clamd_socket=`awk '$1 == "LocalSocket" { print $2 }' /etc/clamd.conf` |
14 |
clamconf | \ |
|
|
15 |
sed 's/["=]//g' | \ |
16 |
awk "{ |
17 |
if(\$0==\"Config file: $1.conf\")S=1 |
18 |
if(S==1&&\$0==\"\")exit |
19 |
if(S==1&&\$1~\"^$2\$\"){ |
20 |
print \$2!=\"disabled\"?\$2:\"$3\"; |
21 |
exit |
22 |
} |
23 |
}" |
24 |
} |
15 |
|
25 |
|
|
|
26 |
start() { |
27 |
local clamd_socket=$(get_config clamd LocalSocket /tmp/clamd) |
28 |
local clamd_socket_dir=`dirname ${clamd_socket}` |
16 |
logfix |
29 |
logfix |
17 |
|
30 |
|
18 |
if [ "${START_CLAMD}" = "yes" ]; then |
31 |
if [ "${START_CLAMD}" = "yes" ]; then |
19 |
if [ -S "${clamd_socket:-/tmp/clamd}" ]; then |
32 |
if [ ! -e "${clamd_socket_dir}" ]; then |
20 |
rm -f ${clamd_socket:-/tmp/clamd} |
33 |
mkdir ${clamd_socket_dir} |
|
|
34 |
chown $(get_config clamd User clamav) ${clamd_socket_dir} |
35 |
fi |
36 |
if [ -S "${clamd_socket}" ]; then |
37 |
rm -f ${clamd_socket} |
21 |
fi |
38 |
fi |
22 |
ebegin "Starting clamd" |
39 |
ebegin "Starting clamd" |
23 |
start-stop-daemon --start --quiet \ |
40 |
start-stop-daemon --start --quiet \ |
Lines 75-82
Link Here
|
75 |
if [ "${START_CLAMD}" = "yes" ]; then |
92 |
if [ "${START_CLAMD}" = "yes" ]; then |
76 |
# fix clamd log permissions |
93 |
# fix clamd log permissions |
77 |
# (might be clobbered by logrotate or something) |
94 |
# (might be clobbered by logrotate or something) |
78 |
local logfile=`awk '$1 == "LogFile" { print $2 }' /etc/clamd.conf` |
95 |
local logfile=$(get_config clamd LogFile) |
79 |
local clamav_user=`awk '$1 == "User" { print $2 }' /etc/clamd.conf` |
96 |
local clamav_user=$(get_config clamd User) |
80 |
if [ -n "${logfile}" ] && [ -n "${clamav_user}" ]; then |
97 |
if [ -n "${logfile}" ] && [ -n "${clamav_user}" ]; then |
81 |
if [ ! -f "${logfile}" ]; then |
98 |
if [ ! -f "${logfile}" ]; then |
82 |
touch ${logfile} |
99 |
touch ${logfile} |
Lines 89-96
Link Here
|
89 |
if [ "${START_FRESHCLAM}" = "yes" ]; then |
106 |
if [ "${START_FRESHCLAM}" = "yes" ]; then |
90 |
# fix freshclam log permissions |
107 |
# fix freshclam log permissions |
91 |
# (might be clobbered by logrotate or something) |
108 |
# (might be clobbered by logrotate or something) |
92 |
logfile=`awk '$1 == "UpdateLogFile" { print $2 }' /etc/freshclam.conf` |
109 |
local logfile=$(get_config freshclam UpdateLogFile) |
93 |
local freshclam_user=`awk '$1 == "DatabaseOwner" { print $2 }' /etc/freshclam.conf` |
110 |
local freshclam_user=$(get_config freshclam DatabaseOwner clamav) |
94 |
if [ -n "${logfile}" -a -n "${clamav_user}" ]; then |
111 |
if [ -n "${logfile}" -a -n "${clamav_user}" ]; then |
95 |
if [ ! -f "${logfile}" ]; then |
112 |
if [ ! -f "${logfile}" ]; then |
96 |
touch ${logfile} |
113 |
touch ${logfile} |