View Single Post
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 03-17-2019 , 09:29   Re: BASH server wedges away
Reply With Quote #2

Cleaning up VPS today for new hardware. I found the script I used before this and before running own server hosting PHP script instead of getting it from game-monitor. They shutdown and that helped me do more than just Drupalize.

PHP Code:
#!/bin/sh
SERVER=NAMEYOURSERVER
IP
=TYPEYOURIP
PORT
=27015
BAD
="999"


#NBR=`GET http://module.game-monitor.com/YOURIP:27016/data/server.js |
#grep -w "query_time" | rev | cut -c 5-8 | rev`

NBR=`GET http://goldsrc.live/servers/info/$IP:$PORT |grep ms|cut -d "<" -f 2|cut -d ">" -f2|cut -d " " -f1`

if [ 
$BAD \> $NBR ]; then
    
echo "$SERVER IS RUNNING...latency is calculating as"
    
echo $NBR
else
    echo 
"$SERVER WEDGED...latency is calculating as"
    
echo $NBR
    
~/crashb.sh
fi 
__________________

Last edited by DJEarthQuake; 03-29-2019 at 12:33. Reason: made NBR 2019 current
DJEarthQuake is offline