diff --git a/SkywarnPlus.py b/SkywarnPlus.py index e1b307e..37f2dab 100644 --- a/SkywarnPlus.py +++ b/SkywarnPlus.py @@ -905,6 +905,7 @@ def alertScript(alerts): if mapping.get("Type") == "BASH": logger.debug('Mapping type is "BASH"') for cmd in commands: + cmd = cmd.format(alert_title=alert) # Replace placeholder with alert title logger.info("AlertScript: Executing BASH command: %s", cmd) subprocess.run(cmd, shell=True) elif mapping.get("Type") == "DTMF": diff --git a/config.yaml b/config.yaml index fd0d8d1..fc55e1f 100644 --- a/config.yaml +++ b/config.yaml @@ -327,10 +327,12 @@ AlertScript: # This is an example entry that will automatically execute SkyDescribe and # announce the full details of a Tornado Warning when it is detected. + # The placeholder '{alert_title}' will be replaced with the title of the alert + # when AlertScript executes the command. - Type: BASH Commands: - - '/usr/local/bin/SkywarnPlus/SkyDescribe.py "Tornado Warning"' + - '/usr/local/bin/SkywarnPlus/SkyDescribe.py "{alert_title}"' Triggers: - Tornado Warning