From 17f714057a3e9042cd6ce7cdd324d4198ed3cc0b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 21 Aug 2002 19:42:43 +0000 Subject: Further pingctl fixes --- tools/pingctl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/pingctl b/tools/pingctl index f175c76..02468f0 100755 --- a/tools/pingctl +++ b/tools/pingctl @@ -8,7 +8,7 @@ set -e ################################################################ # You perhaps want to change those items -USER=echolot +USER=pinger VERBOSE=0 PINGD="/home/pinger/echolot/pingd" @@ -71,13 +71,21 @@ case $1 in start) echo -n "Starting Echolot: pingd" - $SU $PINGD --detach $VERBOSE start + if [ ! -z "$SU" ]; then + $SU "$PINGD --detach $VERBOSE start" + else + $PINGD --detach $VERBOSE start + fi echo "." ;; stop) echo -n "Stopping Echolot: pingd" - $SU $PINGD stop + if [ ! -z "$SU" ]; then + $SU "$PINGD stop" + else + $PINGD stop + fi echo "." ;; @@ -88,7 +96,11 @@ reload|force-reload|restart) ;; process|add|delete|set|setremailercaps|deleteremailercaps|getkeyconf|buildstats|buildkeys|buildthesaurus|dumpconf) echo "Running pingd $1..." - $SU $PINGD "$@" + if [ ! -z "$SU" ]; then + $SU "$PINGD \"$@\"" + else + $PINGD "$@" + fi echo "done." ;; *) -- cgit v1.2.3