Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create script-hooks.md #96

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions configuration/script-hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Script Hooks

You can create scripts that run before, after, or after in case of error for any command.

## Hook Scripts Location

Relative to your installation directory, create a folder: `lgsm/hooks`

## Script Naming

Script hooks are named according to this convention: `hook-<when>-<command>.sh`

`<when>` can have the values `pre`, `post`, or `error`. Post and error hooks are mutually exclusive and never run within the same command.

`<command>` must match long command names. You can find the commands [here](../commands/README.md). The middle column has the command names. Not the leftmost column with the humand-readable command description.

### Behavior

LGSM will run the script and then continue without checking exit value.

## Notes

Don't forget to make the scripts executable!