mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-12 10:58:28 +00:00
Change isTheServerRunning to be consistent with doStop
This commit is contained in:
parent
2110bc7fa6
commit
3759904f12
@ -243,14 +243,22 @@ function getAvailableVersion(){
|
||||
return $bnumber
|
||||
}
|
||||
|
||||
#
|
||||
# Get the PID of the server process
|
||||
#
|
||||
function getServerPID(){
|
||||
ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'
|
||||
}
|
||||
|
||||
#
|
||||
# Check id the server process is alive
|
||||
#
|
||||
function isTheServerRunning(){
|
||||
SERVICE="ShooterGameServer"
|
||||
ps aux | grep -v grep | grep $SERVICE > /dev/null
|
||||
result=$?
|
||||
return $result
|
||||
if [ -n "`getServerPID`" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
@ -327,7 +335,7 @@ doStop() {
|
||||
tput sc
|
||||
echo "Stopping server..."
|
||||
# kill the server with the PID
|
||||
PID=`ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'`
|
||||
PID=`getServerPID`
|
||||
kill -INT $PID
|
||||
|
||||
tput rc; tput ed;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user