User Story
I am administrating several arkservers for a small community using LGSM, and i have found
myself in need of a Pre and/or Post hook system (Mainly Post-update, Pre-start).
This is due to a (not directly related) bug in SteamCMD that makes mods of >1GiB size fail to download on the first attempt, and i wanted to write a tool that basically handles that downloading instead of SteamCMD directly. But as i am using LGSM, i would have to either wrap the whole lgsm script (which would be possible, but not really elegant) or completely reinvent it for Ark.
Basic info
- Distro: Debian GNU/Linux 9.12 (stretch)
- Game: Ark Survival Evolved
- Command: update / start
- LinuxGSM version: v19.12.5
Further Information
Arguments
The hooks themselves dont need to provide a lot of information really, mainly 3 arguments.
- Game
- Instance Name
- Install Path
The motivation for using args (or, if needed environment variables) is that it does not rely on any bash-internals, and thus hooks can be written in any language that can be called as a file.
(bash, python, nodejs, it would even enable the use of things like sciptisto or directly compiling the hook to a binary.
Installation
I would envision either a simple directory like hooks under the default lgsm config path
or a more complicated hooks/[pre|post]-[target] directory where multiple scripts get executed in alphabetical order order (with target being the name of the command, like start, stop, ...).
Running
Given the 3 arguments specified above lgsm should only have to call the script / program like this
(with LGSM_DIR being the lgsm install directory)
$LGSM_DIR/hooks/post-update arkserver yourfancyinstance /home/arkuser/serverfiles/
Additionally, if 1 hook exits with a non 0 exit code, lgsm should abort completly.
Further Reading
Here i was mainly inspired by both pacman Pre/Post Transaction hooks and git hooks
User Story
I am administrating several arkservers for a small community using LGSM, and i have found
myself in need of a Pre and/or Post hook system (Mainly Post-update, Pre-start).
This is due to a (not directly related) bug in SteamCMD that makes mods of >1GiB size fail to download on the first attempt, and i wanted to write a tool that basically handles that downloading instead of SteamCMD directly. But as i am using LGSM, i would have to either wrap the whole lgsm script (which would be possible, but not really elegant) or completely reinvent it for Ark.
Basic info
Further Information
Arguments
The hooks themselves dont need to provide a lot of information really, mainly 3 arguments.
The motivation for using args (or, if needed environment variables) is that it does not rely on any bash-internals, and thus hooks can be written in any language that can be called as a file.
(bash, python, nodejs, it would even enable the use of things like sciptisto or directly compiling the hook to a binary.
Installation
I would envision either a simple directory like
hooksunder the default lgsm config pathor a more complicated
hooks/[pre|post]-[target]directory where multiple scripts get executed in alphabetical order order (with target being the name of the command, likestart,stop, ...).Running
Given the 3 arguments specified above lgsm should only have to call the script / program like this
(with LGSM_DIR being the lgsm install directory)
$LGSM_DIR/hooks/post-update arkserver yourfancyinstance /home/arkuser/serverfiles/Additionally, if 1 hook exits with a non 0 exit code, lgsm should abort completly.
Further Reading
Here i was mainly inspired by both
pacmanPre/Post Transaction hooks andgithooks