- read -r query
- query="`echo "$query" | cut -f2 -d' ' | sed 's:[\r\n]::g'`"
- QUERY_STRING="$query" "$prog" 2>> "$LOG" &
+ if [ -e "$PIDF" ]; then
+ read -r query
+ selector="`echo "$query" | cut -f1 -d' ' | sed 's:[\r\n]::g'`"
+ query="`echo "$query" | cut -f2 -d' ' | sed 's:[\r\n]::g'`"
+ if [ "$query" = "" ]; then
+ if [ "$defn" = "" ]; then
+ echo "7Search $selector $ADDR $port"
+ else
+ echo "$defn"
+ fi
+ else
+ QUERY_STRING="$query" "$prog" 2>> "$LOG" &
+ fi
+ fi