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.
This commit is contained in:
Sebastian Grewe 2013-07-11 09:50:51 +02:00
parent 4b684ac45a
commit dad727a8f0

View File

@ -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