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 --- NEWS | 2 +- tools/pingctl | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 5152b29..14ce420 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,7 @@ Changes in version * Write REMAIL n to mix.cfg - apparently it defaults to yes, which means Mixmaster will want to create keys. * Fix random typos. - * Fix syntax error in pingctl. + * Fix pingctl script. Changes in version 2.0beta30 - 2002-08-15 * Write NAME and ADDRESS to mix.cfg - mix cannot figure it out 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