What if ran as root?

This commit is contained in:
2018-02-23 11:28:45 +01:00
parent c35290ae2d
commit 33f5012583
3 changed files with 17 additions and 2 deletions

View File

@@ -2,6 +2,13 @@
set -euo pipefail
IFS=$'\n\t'
# if started as root
if [ $UID -eq 0 ]
then
find /data \! -user executor -exec chown executor:executor {} \;
su executor -c cron-command
exit $?
fi
# check lock
lock=/var/run/cloner.pid