From bccdcf2ca3380b98a8237cb06c733f29fc2dc68f Mon Sep 17 00:00:00 2001 From: kalipso Date: Tue, 31 Oct 2023 00:45:44 +0100 Subject: [PATCH] [docs] add README for triggers and actions --- docs/actions/README.md | 22 ++++++++++++++++++++++ docs/triggers/README.md | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/docs/actions/README.md b/docs/actions/README.md index 1060a65..ed2041e 100644 --- a/docs/actions/README.md +++ b/docs/actions/README.md @@ -1 +1,23 @@ # Actions + +Actions are executed when their parent Trigger got triggered. +They then perform some certain task depending on the specific action. +Those can vary from shutding down the machine, removing a file or running a bash command. +**Some Actions may cause permanent damage to the system. This is intended but should be used with caution.** + +Actions can have a ```Stage``` assigned to define in which order they should run. +The lowest stage is executed first and only when finished the next stage is executed. +Actions on the same Stage run concurrently. + +Actions have the following syntax: +``` json +{ + "type": "SomeAction", + "options": { //each action defines its own options + "firstOption": "someValue", + "Stage": 2 //this (positive) number defines the order of multiple actions + } +} +``` + +To get a list of all actions and their options from the commandline run ``` gokill -d ``` diff --git a/docs/triggers/README.md b/docs/triggers/README.md index e773cf1..45743f3 100644 --- a/docs/triggers/README.md +++ b/docs/triggers/README.md @@ -1 +1,21 @@ # Triggers + +Triggers wait for certain events and execute the actions defined for them. +There are different Triggers for different use cases. +For example ```UsbDisconnect``` is triggered when a certain Usb Drive is unplugged. +If you want your actions to be triggered when an ethernet cable is pulled use ```EthernetDisconnect``` instead. + +Triggers have the following syntax: +``` json +{ + "type": "SomeTrigger", + "name": "MyFirstTrigger", + "options": { //each trigger defines its own options + "firstOption": 23, + "secondOption": "foo" + }, + "actions": [] //list actions that should be executed here +} +``` + +To get a list of all triggers and their options from the commandline run ```gokill -d```