summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-08-21 19:42:43 +0000
committerPeter Palfrader <peter@palfrader.org>2002-08-21 19:42:43 +0000
commit17f714057a3e9042cd6ce7cdd324d4198ed3cc0b (patch)
treee0523690bf090395003593b3d0bdb3ced5c3d713
parent58c3f95e5cae89ac790a7dfe4d0b4f317b0e1ba6 (diff)
Further pingctl fixes
-rw-r--r--NEWS2
-rwxr-xr-xtools/pingctl20
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."
;;
*)