6
0
Fork 0
This repository has been archived on 2022-03-14. You can view files and clone it, but cannot push or open issues or pull requests.
cdist-recycledcloud/type/__nftables/manifest

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