ソースを参照

Final adjustment for update-centos7 and update-debian8

dpeca 9 年 前
コミット
70d26175ea
2 ファイル変更8 行追加7 行削除
  1. 7 6
      upd/update-centos7-v16-to-v17.sh
  2. 1 1
      upd/update-debian8-v16-to-v17.sh

+ 7 - 6
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
 

+ 1 - 1
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