-
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firewall: Add a custom script that run-parts the hooks instead of cal…
…ling yunohost hook that takes lock
- Loading branch information
1 parent
7bb4779
commit 6802b91
Showing
2 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
# This override config calls yunohost hooks when nftables is started/reloaded | ||
|
||
[Service] | ||
ExecStart=yunohost hook callback post_nftables | ||
ExecReload=yunohost hook callback post_nftables | ||
# This one is legacy, apps should use the new post_nftables hook | ||
ExecStart=yunohost hook callback post_iptable_rules | ||
ExecReload=yunohost hook callback post_iptable_rules | ||
ExecStart=/usr/share/yunohost/yunohost-nftables-hooks |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
HOOK_FOLDER="/usr/share/yunohost/hooks/" | ||
CUSTOM_HOOK_FOLDER="/etc/yunohost/hooks.d/" | ||
|
||
run_parts() { | ||
dir="$1" | ||
if [ -d "$dir" ]; then | ||
run-parts "$dir" | ||
fi | ||
} | ||
|
||
run_parts "$HOOK_FOLDER/post_nftables" | ||
run_parts "$CUSTOM_HOOK_FOLDER/post_nftables" | ||
|
||
# This one is legacy, apps should use the new post_nftables hook | ||
run_parts "$HOOK_FOLDER/post_iptable_rules" | ||
run_parts "$CUSTOM_HOOK_FOLDER/post_iptable_rules" |