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

allow for pre/post/error script hooks after any option #4299

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ffariajr
Copy link

@ffariajr ffariajr commented Aug 29, 2023

Description

Allows custom scripts to be run before or after an LGSM command runs. Also in case of error.
I use this to open ports in my firewall.

Fixes #2764

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Comment update (typo, spelling, explanation, examples, etc).

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue.
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have checked that this code is commented where required.
  • I have provided a detailed enough description of this PR.
  • I have checked if documentation needs updating.

Documentation

If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.

Thank you for your Pull Request!

@ffariajr ffariajr changed the base branch from master to develop August 29, 2023 15:43
@ffariajr
Copy link
Author

Wrong linked issue, the correct issue is #2764

@ffariajr
Copy link
Author

accompanying documentation PR GameServerManagers/LinuxGSM-Docs#96

@dgibbs64
Copy link
Member

What an interesting idea. I would love to know a few more cases that people might do with it. Opening ports is a really good idea.

@ffariajr
Copy link
Author

The user in #2764, although it was 3 years ago, said that there was a bug in SteamCMD with installing mods that are > 1GiB in size, and he wanted to download it using the script instead on Post-Update or Pre-Start.

Off the top of my head, I used to run a small Minecraft server and I wrote a wrapper script to shut off the anti-virus while the server was running to save on resources.

Or Post-Backup it uploads the backup to a service and deletes the local backup.

@ncraig419
Copy link

could a single hook be added at the very beginning of linuxgsm.sh?
I have a dockerized instance of linuxgsm that take a minute for the network to init before calls for DNS can be made. I would love a way to have a hooked sh wait for the network to respond before allowing any calls to github or steam to fire.
A Normal system boot would prevent this with systemd network needed in the service unit files

LinuxGSM/linuxgsm.sh

Lines 341 to 344 in 8dfed10

# LinuxGSM installer mode.
if [ "${shortname}" == "core" ]; then
# Download the latest serverlist. This is the complete list of all supported servers.
fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GSM failed to debug
3 participants