summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-05-28 18:41:21 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-06-06 15:26:20 +0000
commit0bbe8d655df4bc50d70aeef2d3199a73e0af9f03 (patch)
treef765284c34e9c848ac24f130266d6f9dbd941049 /data/templates
parent47d9eb7e7d8197012ab0aa5e878bd0a3bb83ae33 (diff)
downloadvyos-1x-0bbe8d655df4bc50d70aeef2d3199a73e0af9f03.tar.gz
vyos-1x-0bbe8d655df4bc50d70aeef2d3199a73e0af9f03.zip
event-handler: T3083: Add simple event-handler
Event-handler allows executing a custom script when in logs it detects configured "pattern" A simple implemenation set system event-handler first pattern '.*ssh2.*' set system event-handler first script '/config/scripts/hello.sh'
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/event-handler/systemd_event_handler_service.j211
1 files changed, 11 insertions, 0 deletions
diff --git a/data/templates/event-handler/systemd_event_handler_service.j2 b/data/templates/event-handler/systemd_event_handler_service.j2
new file mode 100644
index 000000000..da35a51c4
--- /dev/null
+++ b/data/templates/event-handler/systemd_event_handler_service.j2
@@ -0,0 +1,11 @@
+[Unit]
+Description=Event handler
+After=network.target
+
+[Service]
+Type=simple
+Restart=always
+ExecStart=/usr/bin/python3 /usr/libexec/vyos/vyos-event-handler.py --config /run/vyos-event-handler.conf
+
+[Install]
+WantedBy=multi-user.target