summaryrefslogtreecommitdiffstats
path: root/ogclient
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-27 14:01:38 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-27 14:27:00 +0200
commit9c2ae873f2e52a596b60a277b64d8cf2130eba40 (patch)
tree55a6d2705fce19dd308e6364a9cdf600087723b3 /ogclient
parent8754c21694b5dff69105a0d9b739dd87088626ee (diff)
live: disable browser operations if the binary is missing
Add shutils.which checks before every browser operations to skip the subprocess call if the binary is missing.
Diffstat (limited to 'ogclient')
-rwxr-xr-xogclient4
1 files changed, 3 insertions, 1 deletions
diff --git a/ogclient b/ogclient
index b302641..39aa3a6 100755
--- a/ogclient
+++ b/ogclient
@@ -13,6 +13,7 @@ import logging
import argparse
import platform
import subprocess
+import shutil
try:
from signal import SIG_DFL, SIGPIPE
except ImportError:
@@ -79,7 +80,8 @@ def main():
LOGLEVEL = CONFIG['opengnsys']['log']
if MODE == 'live':
- proc = subprocess.Popen(["browser", "-qws", URL])
+ if shutil.which('browser'):
+ proc = subprocess.Popen(["browser", "-qws", URL])
if MODE != 'windows':
signal.signal(SIGPIPE, SIG_DFL)