ioemu/daemon

28 lines
746 B
Plaintext
Raw Permalink Normal View History

2018-01-28 16:42:13 +00:00
#!/bin/bash
# (1) Primary init.
#--------------------------------------------------------#
# (1) Get absolute folder #
ROOT=$(dirname `realpath $0`);
# (2) Check required arguments
test $# -lt 1 && echo -e "ERR: Missing argument\n\n\tSATS_IP\tThe ip for the SATS system\n" && exit 1;
SATS_IP=$1;
# (3) Check lock file #
test -f $ROOT/.lock && echo "Daemon already started ($ROOT/.lock)" && exit 1;
touch $ROOT/.lock;
# (2) Set traps before starting any subproccess
#--------------------------------------------------------#
trap "rm $ROOT/.lock 2>/dev/null; exit 1;" HUP INT KILL TERM;
2018-01-28 16:42:13 +00:00
# (3) Wait for trigger to launch server
#--------------------------------------------------------#
# (1) Wait for trigger #
2018-02-01 12:37:40 +00:00
$ROOT/com/pool key123 9999