mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 01:47:13 +00:00
23 lines
416 B
Bash
Executable File
23 lines
416 B
Bash
Executable File
#!/bin/sh
|
|
if ! [ $# -ge 2 ]; then
|
|
echo "Syntax: $0 <server version> <command [arguments]>"
|
|
exit 1
|
|
fi
|
|
|
|
SERVER=$1
|
|
SERVERBASE=$HOME/servers/$SERVER
|
|
SOCKET=$SERVERBASE/build/var/run/socket
|
|
|
|
if ! [ -e $SOCKET ]; then
|
|
echo "$SOCKET not found, using the 'oldbuild'."
|
|
SOCKET=$SERVERBASE/oldbuild/var/run/socket
|
|
fi
|
|
if ! [ -p $SOCKET ]; then
|
|
echo "$SOCKET is not a named pipe (fifo)"
|
|
exit 1
|
|
fi
|
|
|
|
shift
|
|
echo $* > $SOCKET
|
|
|