6
0
Fork 0

Import __nftables from dot-cdist

This commit is contained in:
Timothée Floure 2021-02-25 10:17:26 +01:00
parent cadc027569
commit f0d1eb1d18
Signed by: tfloure
GPG key ID: 4502C902C00A1E12
3 changed files with 24 additions and 0 deletions

23
type/__nftables/manifest Normal file
View file

@ -0,0 +1,23 @@
#!/bin/sh
os=$(cat $__global/explorer/os)
case "$os" in
alpine)
target=/etc/nftables.nft
;;
debian|ubuntu)
target=/etc/nftables.conf
;;
*)
echo "$os is not support at the moment. Exiting" >&2
exit 1
esac
# Required parameter: path to rule files.
rules=$(cat "$__object/parameter/rules")
__package nftables
require="__package/nftables " __file "$target" \
--source "$rules" --mode 0644 \
--onchange "service nftables restart"
require="__package/nftables" __start_on_boot nftables

View file

@ -0,0 +1 @@
rules

View file