From fe9eebf61619fde706a8c24041b2ee8c96683e12 Mon Sep 17 00:00:00 2001
From: Fred Dixon <ffdixon@gmail.com>
Date: Thu, 13 May 2021 18:00:00 -0500
Subject: [PATCH] Run stunclient if it exists

---
 bigbluebutton-config/bin/bbb-conf | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/bigbluebutton-config/bin/bbb-conf b/bigbluebutton-config/bin/bbb-conf
index 99693f0fbd..876685fa2f 100755
--- a/bigbluebutton-config/bin/bbb-conf
+++ b/bigbluebutton-config/bin/bbb-conf
@@ -1252,14 +1252,16 @@ check_state() {
       else
 	STUN_SERVER="$STUN_SERVER 3478"
       fi
-
-      if stunclient --mode full --localport 30000 $STUN_SERVER | grep -q fail; then
-        echo
-        echo "#"
-        echo "# Warning: Failed to verify STUN server at $STUN_SERVER with command"
-        echo "#"
-        echo "#    stunclient --mode full --localport 30000 $STUN_SERVER"
-        echo "#"
+     
+      if which stunclient > /dev/null 2>&1; then 
+        if stunclient --mode full --localport 30000 $STUN_SERVER | grep -q fail; then
+          echo
+          echo "#"
+          echo "# Warning: Failed to verify STUN server at $STUN_SERVER with command"
+          echo "#"
+          echo "#    stunclient --mode full --localport 30000 $STUN_SERVER"
+          echo "#"
+        fi
       fi
     fi
 
-- 
GitLab