2018-07-02 20:49:55 +00:00
|
|
|
config=$(cat "$__object/parameter/config")
|
|
|
|
|
|
|
|
initscript="$__type/files/nftables-init"
|
|
|
|
|
2018-07-08 19:02:03 +00:00
|
|
|
if [ -f "$__object/parameter/config-from_stdin" ]; then
|
|
|
|
srcfile="$__object/stdin"
|
|
|
|
else
|
|
|
|
if [ ! -f "$__object/parameter/config" ]; then
|
|
|
|
echo "Need either config-from-stdin or config" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
srcfile="$__files/nftables/${config}.conf"
|
|
|
|
|
|
|
|
if [ ! -f "$srcfile" ]; then
|
|
|
|
echo "No such config ${config}. Aborting." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-07-02 20:49:55 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
__package nftables
|
|
|
|
__file /etc/nftables.conf --source "$srcfile" --mode 0644
|
|
|
|
__file /etc/init.d/nftables --source "$initscript" --mode 0755
|
|
|
|
|
|
|
|
require="__file/etc/init.d/nftables" __start_on_boot nftables
|