diff --git a/README.md b/README.md index ede36c8..f9587ae 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ Sentry Bot detects anyone coming close to the bot-node. uses the Location Lat/Lo ```ini SentryEnabled = True # detect anyone close to the bot +emailSentryAlerts = True # if SMTP enabled send alert to sysop email list SentryRadius = 100 # radius in meters to detect someone close to the bot SentryChannel = 9 # holdoff time multiplied by seconds(20) of the watchdog SentryHoldoff = 2 # channel to send a message to when the watchdog is triggered diff --git a/config.template b/config.template index 7049828..e98bd49 100644 --- a/config.template +++ b/config.template @@ -85,6 +85,7 @@ alert_interface = 1 [sentry] # detect anyone close to the bot SentryEnabled = True +emailSentryAlerts = False # radius in meters to detect someone close to the bot SentryRadius = 100 # channel to send a message to when the watchdog is triggered diff --git a/modules/settings.py b/modules/settings.py index 75d1fde..66fd5d3 100644 --- a/modules/settings.py +++ b/modules/settings.py @@ -145,6 +145,7 @@ try: sentry_holdoff = config['sentry'].getint('SentryHoldoff', 9) # default 9 sentryIgnoreList = config['sentry'].get('sentryIgnoreList', '').split(',') sentry_radius = config['sentry'].getint('SentryRadius', 100) # default 100 meters + email_sentry_alerts = config['sentry'].getboolean('emailSentryAlerts', False) # default False # location location_enabled = config['location'].getboolean('enabled', True) diff --git a/modules/system.py b/modules/system.py index 6ec5d2e..2bbe7b0 100644 --- a/modules/system.py +++ b/modules/system.py @@ -1051,6 +1051,9 @@ async def handleSentinel(deviceID=1): logger.warning(f"System: {enemySpotted} is close to your location on Interface1 Accuracy is {resolution}bits") send_message(f"Sentry{deviceID}: {enemySpotted}", secure_channel, 0, deviceID) + if enableSMTP and email_sentry_alerts: + for email in sysopEmails: + send_email(email, f"Sentry{deviceID}: {enemySpotted}") handleSentinel_loop = 0 handleSentinel_spotted = enemySpotted else: