summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalkannel-dispatch24
-rwxr-xr-xlocalsmsadmin4
2 files changed, 26 insertions, 2 deletions
diff --git a/localkannel-dispatch b/localkannel-dispatch
index 8e098cc..21fc1bf 100755
--- a/localkannel-dispatch
+++ b/localkannel-dispatch
@@ -166,13 +166,35 @@ fi
case "$app" in
/*)
+ cmd="$(echo "$app" | perl -pe 's/^\///;')"
+ case "$cmd" in
+ ping)
+ shift
+ if [ "help" = "$1" ]; then
+ $sbindir/localsendsms "$to" "Usage:
+/ping [...]
+
+Respond \"pong\" and echo back any addition input."
+ else
+ $sbindir/localsendsms "$to" pong "$@"
+ fi
+ exit 0
+ ;;
+ esac
candidates=$(cd "$vardir/user" && grep -lF "$to" */phone | perl -pe "s,/phone$,,") || candidates=
[ -z "$candidates" ] || $(grep -vqF "$candidates" "$vardir/group/admin/user") || admin=true
if [ -n "$ADMIN_OK" ] && [ -n "$admin" ]; then
- cmd="$(echo "$app" | perl -pe 's/^\///;')"
str="$($sbindir/localsmsadmin "$cmd" "$@" 2>&1)" || exit1 "$str"
$sbindir/localsendsms "$to" $str
exit 0
+ elif [ "help" = "$cmd" ]; then
+ $sbindir/localsendsms "$to" "Commands:
+/ping [...]
+/COMMAND help
+/help
+
+try e.g. \"/del help\"."
+ exit 0
fi
;;
esac
diff --git a/localsmsadmin b/localsmsadmin
index 0fb6fc8..ec891d6 100755
--- a/localsmsadmin
+++ b/localsmsadmin
@@ -367,11 +367,13 @@ EOF
;;
help)
cat <<EOF
-Admin commands:
+Commands:
+/ping [...]
/add user|group|session|default ...
/del user|group|session|default ...
/mission AGENT @VICTIM msg...
/COMMAND help
+/help
try e.g. "/del help".
EOF