mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-26 16:28: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
|
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
|
# Check id the server process is alive
|
||||||
#
|
#
|
||||||
function isTheServerRunning(){
|
function isTheServerRunning(){
|
||||||
SERVICE="ShooterGameServer"
|
if [ -n "`getServerPID`" ]; then
|
||||||
ps aux | grep -v grep | grep $SERVICE > /dev/null
|
return 0
|
||||||
result=$?
|
else
|
||||||
return $result
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -327,7 +335,7 @@ doStop() {
|
|||||||
tput sc
|
tput sc
|
||||||
echo "Stopping server..."
|
echo "Stopping server..."
|
||||||
# kill the server with the PID
|
# kill the server with the PID
|
||||||
PID=`ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'`
|
PID=`getServerPID`
|
||||||
kill -INT $PID
|
kill -INT $PID
|
||||||
|
|
||||||
tput rc; tput ed;
|
tput rc; tput ed;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user