From dad727a8f0a19df73ba66471da6e384a7da7df6f Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Thu, 11 Jul 2013 09:50:51 +0200 Subject: [PATCH] Fix CRONHOME detection if a symlink is used This will fix CRONHOME detection if `run-rcrons.sh` is a symlink in `/etc/cron.minutely`. Before symlinks would not return the proper path. --- cronjobs/run-crons.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cronjobs/run-crons.sh b/cronjobs/run-crons.sh index ab1f482c..0988310c 100755 --- a/cronjobs/run-crons.sh +++ b/cronjobs/run-crons.sh @@ -28,7 +28,11 @@ VERBOSE="0" ################################################################ # Find scripts path -CRONHOME=$( dirname $0 ) +if [[ -L $0 ]]; then + CRONHOME=$( dirname $( readlink $0 ) ) +else + CRONHOME=$( dirname $0 ) +fi # Change working director to CRONHOME if ! cd $CRONHOME 2>/dev/null; then