From 4eb2e6a7bac88b50deca6fd6aa63b3ecdcdf9498 Mon Sep 17 00:00:00 2001 From: dpeca Date: Fri, 15 Nov 2019 15:34:15 +0100 Subject: [PATCH] Better check if session cron already added --- src/deb/vesta/postinst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index efadbc8b..cd650c1f 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -17,7 +17,12 @@ if [ "$check_apt" -eq 1 ]; then echo "deb http://apt.myvestacp.com/$codename/ $codename vesta" > /etc/apt/sources.list.d/vesta.list fi -crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab - + +check_cron=$(grep -c '6 sudo find /home/' /var/spool/cron/crontabs/root) +if [ "$check_cron" -eq 0 ]; then + crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab - +fi + touch /var/lib/clamav/clamd.sock chown clamav:clamav /var/lib/clamav/clamd.sock