path: supertuxkart_1.5-2/tools/run_server.sh run_servers SERVERS_COUNT=$(pidof -x "$CMD" | wc -w) SERVER_OK=1 LOOP=$(($LOOP + 1)) path: supertuxkart_1.5-2/tools/run_server.sh echo "Info: Stop servers" for PID in $(pidof -x "$CMD"); do echo "Info: Killing the STK server $PID" kill -15 $PID path: supertuxkart_1.5-2/tools/run_server.sh while [ $LOOP -lt $MAX_CREATION_RETRIES ]; do if [ $(pidof -x "$CMD" | wc -w) -lt $SERVERS_COUNT ]; then SERVER_OK=0 fi path: supertuxkart_1.5-2/tools/run_server.sh stop() { for PID in $(pidof -x "$DIRNAME/$BASENAME" -o $SELF_PID); do echo "Info: Killing the $BASENAME script $PID" kill -9 $PID path: supertuxkart_1.5-2/tools/run_server.sh sleep 10 for PID in $(pidof -x "$CMD"); do echo "Info: Force killing the STK server $PID" kill -9 $PID path: supertuxkart_1.5-2/tools/run_server.sh start export SERVERS_COUNT=$(pidof -x "$CMD" | wc -w) export SERVER_OK=1 export LOOP=0 path: supertuxkart_1.5-2/tools/run_server.sh fi if [ $(pidof -x "$MESSAGE_CMD" | wc -w) -ge $MAX_MESSAGES ]; then return fi path: supertuxkart_1.5-2/tools/run_server.sh fi if [ ! -z $(pidof -s -x "$CMD") ]; then show_message "Error: Some servers are already running" exit path: supertuxkart_1.5-2/tools/run_server.sh start() { if [ ! -z $(pidof -x "$DIRNAME/$BASENAME" -o $SELF_PID) ]; then show_message "Error: The script is already started" exit