__ungleich_nftables/manifest
Nico Schottelius d1937f3125 change config file AGAIN
Seems like alpine is using /etc/nftables.nft now.
2020-02-04 16:49:10 +01:00

43 lines
948 B
Text

initscript="$__type/files/nftables-init"
os=$(cat $__global/explorer/os)
conf=/etc/nftables.nft
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
config=$(cat "$__object/parameter/config")
srcfile="$__files/nftables/${config}.conf"
if [ ! -f "$srcfile" ]; then
echo "No such config ${config}. Aborting." >&2
exit 1
fi
fi
__package nftables
__file ${conf} --source "$srcfile" --mode 0644
case $os in
# Alpine actually has an init script, as opposed to everyone else
alpine)
:
;;
debian|devuan)
__file /etc/init.d/nftables --source "$initscript" --mode 0755
;;
*)
echo "Unsupported os: $os" >&2
exit 1
;;
esac
require="__package/nftables" __start_on_boot nftables