mirror of
https://github.com/dragonlock2/matthewtran.com.git
synced 2025-10-11 20:17:54 +00:00
15 lines
324 B
Bash
15 lines
324 B
Bash
#!/bin/sh
|
|
|
|
cleanup() {
|
|
echo "exit\n" > cmd
|
|
}
|
|
|
|
trap 'cleanup' TERM
|
|
|
|
rm cmd
|
|
mkfifo cmd
|
|
./TerrariaServer.bin.x86_64 -config config.txt -pass $(cat password.txt) < cmd &
|
|
echo "help\n" > cmd # shell waits for FIFO to be opened for writing before starting program!
|
|
wait $! # wait for SIGTERM
|
|
wait $! # wait for server to stop
|