From 814303c521fbd943199aa0cb38622f3151a3d72a Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 8 Aug 2024 01:47:00 -0700 Subject: [PATCH] fix --- config.template | 15 +++++++-------- modules/settings.py | 7 ++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config.template b/config.template index adece3e..5a972f9 100644 --- a/config.template +++ b/config.template @@ -41,6 +41,12 @@ zuluTime = True URL_TIMEOUT = 10 # logging to file of the non Bot messages LogMessagesToFile = False +# detect anyone close to the bot +SentryEnabled = True +# holdoff time multiplied by minutes(20) of the watchdog +SentryChannel = 9 +# channel to send a message to when the watchdog is triggered +SentryHoldoff = 2 [bbs] enabled = True @@ -88,11 +94,4 @@ signalDetectionThreshold = -10 signalHoldTime = 10 # the following are combined to reset the monitor signalCooldown = 5 -signalCycleLimit = 5 - -[sentry] -sentry_enabled = True -# holdoff time multiplied by minutes(20) of the watchdog -sentry_holdoff = 9 -# channel to send a message to when the watchdog is triggered -secure_channel = 2 \ No newline at end of file +signalCycleLimit = 5 \ No newline at end of file diff --git a/modules/settings.py b/modules/settings.py index ce16957..4288554 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -75,6 +75,9 @@ try: dad_jokes_enabled = config['general'].getboolean('DadJokes', False) store_forward_enabled = config['general'].getboolean('StoreForward', False) log_messages_to_file = config['general'].getboolean('LogMessagesToFile', True) # default True + sentry_enabled = config['general'].getboolean('SentryEnabled', True) # default True + secure_channel = config['general'].getint('SentryChannel', 2) # default 2 + sentry_holdoff = config['general'].getint('SentryHoldoff', 9) # default 9 config['general'].get('motd', MOTD) urlTimeoutSeconds = config['general'].getint('URL_TIMEOUT', 10) # default 10 seconds forecastDuration = config['general'].getint('NOAAforecastDuration', 4) # NOAA forcast days @@ -90,9 +93,7 @@ try: signalHoldTime = config['radioMon'].getint('signalHoldTime', 10) # default 10 seconds signalCooldown = config['radioMon'].getint('signalCooldown', 5) # default 1 second signalCycleLimit = config['radioMon'].getint('signalCycleLimit', 5) # default 5 cycles, used with SIGNAL_COOLDOWN - sentry_enabled = config['sentry'].getboolean('enabled', False) - secure_channel = config['sentry'].getint('secure_channel', 2) # default 2 - sentry_holdoff = config['sentry'].getint('holdoff', 9) # default 9 + except KeyError as e: print(f"System: Error reading config file: {e}") print(f"System: Check the config.ini against config.template file for missing sections or values.")