diff --git a/cronosagent.sh b/cronosagent.sh index c170646..64c4f5a 100755 --- a/cronosagent.sh +++ b/cronosagent.sh @@ -1,9 +1,12 @@ #!/bin/bash -if [ -f cronosagent.conf ] +SCRIPT=$(readlink -f $0) +DIRECTORY=$(dirname $SCRIPT) + +if [ -f $DIRECTORY/cronosagent.conf ] then # Read configuration from text file - source cronosagent.conf + source $DIRECTORY/cronosagent.conf fi if [ -f /etc/config/cronosagent ] @@ -23,7 +26,7 @@ then SERVICE_MODE=$1 fi -./cronosagent \ +$DIRECTORY/cronosagent \ --trap-port 8162 \ --repeater-number ${REPEATER_NUMBER} \ --repeater-address ${REPEATER_ADDRESS} \