Import __nftables from dot-cdist
This commit is contained in:
parent
cadc027569
commit
f0d1eb1d18
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
rules
|
Reference in New Issue