From 0bbe8d655df4bc50d70aeef2d3199a73e0af9f03 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Sat, 28 May 2022 18:41:21 +0000 Subject: 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' --- data/templates/event-handler/systemd_event_handler_service.j2 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 data/templates/event-handler/systemd_event_handler_service.j2 (limited to 'data/templates/event-handler') 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 -- cgit v1.2.3