Created
October 15, 2023 12:37
-
-
Save davidbalbert/dcd0cb87ab4ffdab4e2bead72c1cf936 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# For Ubiquiti EdgeOS | |
# | |
# This script creates a directory /config/scripts/post-commit.d. Any script you put | |
# in that directory will get run every time you commit a new configuration. | |
# | |
# Installation: | |
# - Put this script in /config/scripts/post-config.d. Note that this is a different | |
# directory from the directory this creates. | |
# - Either restart you router or run the script manually. This is the only time | |
# you'll have to do do this. | |
set -e | |
if [ ! -d /config/scripts/post-commit.d ]; then | |
mkdir -p /config/scripts/post-commit.d | |
fi | |
if [ ! -L /etc/commit/post-hooks.d/post-commit-hooks.sh ]; then | |
sudo ln -fs /config/scripts/post-config.d/post-commit-hooks.sh /etc/commit/post-hooks.d | |
fi | |
run-parts --report --regex '^[a-zA-Z0-9._-]+$' /config/scripts/post-commit.d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment