From 70d26175ea70130ca139af58e518bbef77cd3f76 Mon Sep 17 00:00:00 2001 From: dpeca Date: Fri, 18 Nov 2016 09:48:43 -0500 Subject: [PATCH] Final adjustment for update-centos7 and update-debian8 --- upd/update-centos7-v16-to-v17.sh | 13 +++++++------ upd/update-debian8-v16-to-v17.sh | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/upd/update-centos7-v16-to-v17.sh b/upd/update-centos7-v16-to-v17.sh index d11f329d..c14c481e 100755 --- a/upd/update-centos7-v16-to-v17.sh +++ b/upd/update-centos7-v16-to-v17.sh @@ -13,7 +13,7 @@ servername=$(hostname -f) # PATH fix -if [ $( grep -ic "VESTA" /etc/profile.d/vesta.sh ) -eq 0 ]; then +if [ ! -f "/etc/profile.d/vesta.sh" ]; then echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh fi if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then @@ -68,18 +68,19 @@ fi # Fix for clamav: /var/run ownership and foreground option if [ -f "/etc/clamd.conf" ] ; then - chown clam:clam /var/log/clamav /var/run/clamav + if [ ! -d "/var/run/clamav" ]; then + mkdir /var/run/clamav + fi + chown -R clam:clam /var/run/clamav + chown -R clam:clam /var/log/clamav if [ "$release" -eq '7' ]; then sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service file="/usr/lib/systemd/system/clamd.service" if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then 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 - if [ ! -d "/var/run/clamav" ]; then - mkdir /var/run/clamav - fi - chown -R clam:clam /var/run/clamav fi systemctl daemon-reload + /bin/systemctl restart clamd.service fi fi diff --git a/upd/update-debian8-v16-to-v17.sh b/upd/update-debian8-v16-to-v17.sh index be7d9025..267d5fbf 100755 --- a/upd/update-debian8-v16-to-v17.sh +++ b/upd/update-debian8-v16-to-v17.sh @@ -13,7 +13,7 @@ apt-get update > /dev/null 2>&1 # PATH fix -if [ $( grep -ic "VESTA" /etc/profile.d/vesta.sh ) -eq 0 ]; then +if [ ! -f "/etc/profile.d/vesta.sh" ]; then echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh fi if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then