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:
parent
4b684ac45a
commit
dad727a8f0
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user