File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1045,8 +1045,8 @@ if [ "$clamd" = 'yes' ]; then
10451045 mkdir /var/run/clamav
10461046 fi
10471047 chown -R clamav:clamav /var/run/clamav
1048- if [ -f " /etc /systemd/system/multi-user.target.wants /clamav-daemon.service" ]; then
1049- file=" /etc /systemd/system/multi-user.target.wants /clamav-daemon.service"
1048+ if [ -f " /lib /systemd/system/clamav-daemon.service" ]; then
1049+ file=" /lib /systemd/system/clamav-daemon.service"
10501050 if [ $( grep -ic " mkdir" $file ) -eq 0 ]; then
10511051 sed -i " s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
10521052 fi
Original file line number Diff line number Diff line change 121121
122122
123123# Fixing /var/run/clamav permissions
124- if [ -f " /etc /systemd/system/multi-user.target.wants /clamav-daemon.service" ]; then
125- file=" /etc /systemd/system/multi-user.target.wants /clamav-daemon.service"
124+ if [ -f " /lib /systemd/system/clamav-daemon.service" ]; then
125+ file=" /lib /systemd/system/clamav-daemon.service"
126126 if [ $( grep -ic " mkdir" $file ) -eq 0 ]; then
127127 sed -i " s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
128- service clamav-daemon restart
128+ if [ ! -d " /var/run/clamav" ]; then
129+ mkdir /var/run/clamav
130+ fi
131+ chown -R clamav:clamav /var/run/clamav
132+ service clamav-daemon restart /dev/null 2>&1
129133 fi
130134fi
You can’t perform that action at this time.
0 commit comments