mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
add fallback for when binary is not in path
This commit is contained in:
parent
84356e5785
commit
f8cbc6081b
1 changed files with 8 additions and 1 deletions
|
|
@ -62,7 +62,14 @@ class System implements ISystem {
|
||||||
$result = null;
|
$result = null;
|
||||||
$output = [];
|
$output = [];
|
||||||
exec("which $binary 2>&1", $output, $result);
|
exec("which $binary 2>&1", $output, $result);
|
||||||
$this->paths[$binary] = $result === 0 && isset($output[0]) ? (string)$output[0] : null;
|
|
||||||
|
if ($result === 0 && isset($output[0])) {
|
||||||
|
$this->paths[$binary] = (string)$output[0];
|
||||||
|
} else if (is_executable("/usr/bin/$binary")) {
|
||||||
|
$this->paths[$binary] = "/usr/bin/$binary";
|
||||||
|
} else {
|
||||||
|
$this->paths[$binary] = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this->paths[$binary];
|
return $this->paths[$binary];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue