22 lines
498 B
Bash
Executable File
22 lines
498 B
Bash
Executable File
#!/bin/bash
|
|
server="$1"
|
|
shift
|
|
|
|
if ! [[ -e ./vars ]] ; then
|
|
echo 'Please create a "vars" file using "vars.example" as a template'
|
|
exit 1
|
|
fi
|
|
source ./vars
|
|
|
|
cmd="$1"
|
|
shift
|
|
|
|
code_clear=$'\x05\x15'
|
|
code_send=$'\r'
|
|
|
|
case "$cmd" in
|
|
stop) tmux send-keys -t "$TMUX_SESSION" -l "$code_clear" 'stop' "$code_send" ;;
|
|
command) tmux send-keys -t "$TMUX_SESSION" -l "$code_clear" "$*" "$code_send" ;;
|
|
*) tmux new-window -t $TMUX_SESSION: "./start.sh" || tmux new-session -s $TMUX_SESSION "./start.sh";;
|
|
esac
|