$OpenBSD: patch-LibreNMS_Config_php,v 1.15 2021/06/20 11:33:06 sthen Exp $

openbsd (and netbsd) whereis don't support -b, neither do they prefix the
output with the name of the searched command.

Index: LibreNMS/Config.php
--- LibreNMS/Config.php.orig
+++ LibreNMS/Config.php
@@ -503,8 +503,12 @@ class Config
     public static function locateBinary($binary)
     {
         if (! Str::contains($binary, '/')) {
-            $output = `whereis -b $binary`;
-            $list = trim(substr($output, strpos($output, ':') + 1));
+            $output = `whereis $binary`;
+            if (strpos($output, ':')) {
+                $list = trim(substr($output, strpos($output, ':') + 1));
+            } else {
+                $list = trim($output);
+            }
             $targets = explode(' ', $list);
             foreach ($targets as $target) {
                 if (is_executable($target)) {
