2018-01-29 13:04:31 +00:00
#!/bin/bash
# (1) Primary init.
#--------------------------------------------------------#
# (1) Get absolute folder #
ROOT=$(dirname `realpath $0`);
ROOT=`dirname $ROOT`;
2018-01-29 14:30:43 +00:00
# (2) Check required arguments
2018-01-30 21:53:40 +00:00
test $# -lt 2 && echo -e "error: too few arguments\n\n\e[1mUSAGE\e[0m\n\tmain <key> <host>\n\n\e[1mARGUMENTS\e[0m\n\t<key>\tThe key of the pool\n\t<host>\tThe host where the pool is hosted\n" && exit 1;
2018-01-29 13:04:31 +00:00
2018-01-30 21:53:40 +00:00
# (3) Store arguments #
POOL_KEY="$1";
POOL_HOST="$2";
2018-01-29 13:04:31 +00:00
2018-01-30 21:53:40 +00:00
# (2) Start server in background (keep PID)
2018-01-29 13:04:31 +00:00
#--------------------------------------------------------#
2018-01-30 21:53:40 +00:00
# (1) Launch master and all deamons #
$ROOT/com/master $POOL_KEY $POOL_HOST 9999 $ROOT/sats/daemon;