Skip to content

Commit 70d2617

Browse files
committed
Final adjustment for update-centos7 and update-debian8
1 parent 37fa99b commit 70d2617

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

upd/update-centos7-v16-to-v17.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ servername=$(hostname -f)
1313

1414

1515
# PATH fix
16-
if [ $( grep -ic "VESTA" /etc/profile.d/vesta.sh ) -eq 0 ]; then
16+
if [ ! -f "/etc/profile.d/vesta.sh" ]; then
1717
echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh
1818
fi
1919
if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then
@@ -68,18 +68,19 @@ fi
6868

6969
# Fix for clamav: /var/run ownership and foreground option
7070
if [ -f "/etc/clamd.conf" ] ; then
71-
chown clam:clam /var/log/clamav /var/run/clamav
71+
if [ ! -d "/var/run/clamav" ]; then
72+
mkdir /var/run/clamav
73+
fi
74+
chown -R clam:clam /var/run/clamav
75+
chown -R clam:clam /var/log/clamav
7276
if [ "$release" -eq '7' ]; then
7377
sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service
7478
file="/usr/lib/systemd/system/clamd.service"
7579
if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
7680
sed -i "s/Type = simple/Type = simple\nExecStartPre = \/usr\/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/usr\/bin\/chown -R clam:clam \/var\/run\/clamav/g" $file
77-
if [ ! -d "/var/run/clamav" ]; then
78-
mkdir /var/run/clamav
79-
fi
80-
chown -R clam:clam /var/run/clamav
8181
fi
8282
systemctl daemon-reload
83+
/bin/systemctl restart clamd.service
8384
fi
8485
fi
8586

upd/update-debian8-v16-to-v17.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ apt-get update > /dev/null 2>&1
1313

1414

1515
# PATH fix
16-
if [ $( grep -ic "VESTA" /etc/profile.d/vesta.sh ) -eq 0 ]; then
16+
if [ ! -f "/etc/profile.d/vesta.sh" ]; then
1717
echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh
1818
fi
1919
if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then

0 commit comments

Comments
 (0)