Added SATS.server lock file
This commit is contained in:
parent
591f0beb4f
commit
bf3f011bd4
16
sats/main
16
sats/main
|
@ -12,9 +12,15 @@ test $# -lt 1 && echo -e "ERR: Missing argument\n\n\tSATS_ID\tThe id for the bas
|
||||||
|
|
||||||
# (2) Start server in background (keep PID)
|
# (2) Start server in background (keep PID)
|
||||||
#--------------------------------------------------------#
|
#--------------------------------------------------------#
|
||||||
# (1) Start server #
|
# (1) Start server (if not already done) #
|
||||||
$ROOT/com/launch sats $1 44441 44440 9999&
|
if [ ! -f $ROOT/sats/.lock ]; then
|
||||||
SERV_PID=$!;
|
|
||||||
|
$ROOT/com/launch sats $1 44441 44440 9999&
|
||||||
|
SERV_PID=$!;
|
||||||
|
|
||||||
|
touch $ROOT/sats/.lock;
|
||||||
|
|
||||||
|
fi;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,6 +54,10 @@ on_exit(){
|
||||||
echo 'sats.server.kill';
|
echo 'sats.server.kill';
|
||||||
kill -9 $SERV_PID 2>/dev/null;
|
kill -9 $SERV_PID 2>/dev/null;
|
||||||
|
|
||||||
|
## {4} Delete lock file ##
|
||||||
|
echo 'sats.server.lock.delete';
|
||||||
|
rm $ROOT/sats/.lock 2>/dev/null;
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue