-BLOCKEDFILE=/home/lonvia/nominatim/settings/ip_blocks
-LOGFILE=/home/lonvia/nominatim/log/ip_blocks.log
+BASEDIR="$( cd "$( dirname "$0" )" && cd .. && pwd )"
+if [ "x$BASEDIR" == "x" ]; then
+ echo "Could not determine base dir."
+ exit -1
+fi
+
+BLOCKEDFILE=$BASEDIR/settings/ip_blocks
+LOGFILE=$BASEDIR/log/ip_blocks.log