Check if lsof exists before using it

This commit is contained in:
Ben Peddell 2016-10-23 14:10:10 +10:00
parent 653f9a5cd0
commit 772398ffc0

View File

@ -641,8 +641,11 @@ function isTheServerRunning(){
#
#
function isTheServerUp(){
$lsof -i "${ark_MultiHome:+udp@}${ark_MultiHome}:$(getGamePort)" > /dev/null
result=$?
result=1
if [ ! -x "$lsof" ]; then
"$lsof" -i "${ark_MultiHome:+udp@}${ark_MultiHome}:$(getGamePort)" > /dev/null
result=$?
fi
if [ $result -ne 0 ]; then
perl -MSocket -MFcntl -e '
my $port = int($ARGV[0]);