Fix lsof not being used when it is not at /usr/sbin/lsof

This commit is contained in:
Ben Peddell 2021-07-15 08:20:15 +10:00 committed by GitHub
parent 10f7cdf466
commit 63b9d565c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -968,7 +968,7 @@ function isTheServerRunning(){
function isTheServerUp(){
local ip="$(getMultiHome)"
result=1
if [ -x "$lsof" ]; then
if [ -x "$( which "$lsof" )" ]; then
"$lsof" -w -i "${ip:+udp@}${ip}:$(getGamePort)" > /dev/null
result=$?
fi