send_campaignd_command: Add to repository
This commit is contained in:
parent
4f227059cf
commit
548efbbf97
1 changed files with 22 additions and 0 deletions
22
utils/mp-server/send_campaignd_command
Executable file
22
utils/mp-server/send_campaignd_command
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
die() { echo >&2 "$@"; exit 1; }
|
||||
|
||||
[ $# -ge 1 ] || die "Syntax: $0 <campaignd version> <command [arguments]>"
|
||||
|
||||
VERSION=$1
|
||||
|
||||
PREFIX="$HOME/campaignd"
|
||||
SERVERBASE="$PREFIX/$VERSION"
|
||||
SOCKET="$SERVERBASE/socket"
|
||||
|
||||
[ -d "$SERVERBASE" ] || die "'$VERSION' add-ons server instance not found."
|
||||
|
||||
[ -p "$SOCKET" ] || die "'$SOCKET' not found or is not a FIFO.
|
||||
Is the '$VERSION' add-ons server instance running?"
|
||||
|
||||
shift
|
||||
|
||||
echo "$@" > "$SOCKET"
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue