24 lines
495 B
Bash
24 lines
495 B
Bash
#!/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
|