f74df5962e
Signed-off-by: fbt <fbt@fleshless.org>
27 lines
573 B
Plaintext
Executable File
27 lines
573 B
Plaintext
Executable File
#!/usr/bin/env ssm
|
|
|
|
# nftables ruleset.
|
|
#
|
|
# There is no nftables daemon: the ruleset is applied at startup and
|
|
# stays in the kernel until changed. We therefore treat this as a oneshot
|
|
# service whose real job is to apply the ruleset.
|
|
|
|
service_oneshot = yes
|
|
service_command = /usr/sbin/nft -f /etc/nftables.conf
|
|
|
|
var nftables_conf = /etc/nftables.conf
|
|
|
|
check_config() {
|
|
[[ ! -f "$nftables_conf" ]] && err "nftables config not found: $nftables_conf"
|
|
}
|
|
|
|
pre_start() {
|
|
check_config || return 17
|
|
}
|
|
|
|
reload() {
|
|
check_config || return 17
|
|
|
|
/usr/sbin/nft -f "$nftables_conf"
|
|
}
|