Import __nftables from dot-cdist
This commit is contained in:
parent
cadc027569
commit
f0d1eb1d18
3 changed files with 24 additions and 0 deletions
23
type/__nftables/manifest
Normal file
23
type/__nftables/manifest
Normal 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
|
1
type/__nftables/parameter/required
Normal file
1
type/__nftables/parameter/required
Normal file
|
@ -0,0 +1 @@
|
|||
rules
|
0
type/__nftables/singleton
Normal file
0
type/__nftables/singleton
Normal file
Reference in a new issue