Final adjustment for update-centos7 and update-debian8

This commit is contained in:
dpeca 2016-11-18 09:48:43 -05:00
parent 37fa99b757
commit 70d26175ea
2 changed files with 8 additions and 7 deletions

View file

@ -13,7 +13,7 @@ servername=$(hostname -f)
# PATH fix # 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 echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh
fi fi
if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then
@ -68,18 +68,19 @@ fi
# Fix for clamav: /var/run ownership and foreground option # Fix for clamav: /var/run ownership and foreground option
if [ -f "/etc/clamd.conf" ] ; then 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 if [ "$release" -eq '7' ]; then
sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service
file="/usr/lib/systemd/system/clamd.service" file="/usr/lib/systemd/system/clamd.service"
if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then 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 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 fi
systemctl daemon-reload systemctl daemon-reload
/bin/systemctl restart clamd.service
fi fi
fi fi

View file

@ -13,7 +13,7 @@ apt-get update > /dev/null 2>&1
# PATH fix # 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 echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh
fi fi
if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then if [ $( grep -ic "vesta" /root/.bash_profile ) -eq 0 ]; then