diff --git a/bin/localsearch.sh b/bin/localsearch.sh
index 3d43b2807..8acf586ba 100755
--- a/bin/localsearch.sh
+++ b/bin/localsearch.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+cd "`dirname $0`"
port=$(grep ^port= ../DATA/SETTINGS/yacy.conf |cut -d= -f2)
if which curl &>/dev/null; then
curl -s "http://localhost:$port/yacysearch.rss?resource=local&verify=false&query=$1" | awk '/^/{ gsub("","" );gsub("<\/link>","" ); print $0 }'