blob: b9650ecaa7e2d96677bda6d5e753c1a7bb10b4dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
post_install() {
echo ":: NFF has been installed."
echo ":: If you want nff to manage the entire nftables rulesets, please change 'exclusive' to 'true' in /etc/nff.yml"
echo ":: Please make sure the gateway interface in /etc/nftables.d/00-nff.nft is set properly, otherwise run \`sudo nff apply\` to have it generate that for you"
/usr/bin/nft flush ruleset
systemctl restart nftables
echo ":: NFF ruleset has been applied alongside the existing rulesets. There may be conflicts between the tables. If so, please resolve them by setting exclusive or purposefully destroying the other rulesets"
}
post_upgrade() {
post_install
}
pre_remove() {
echo ":: Flushing NFF ruleset..."
/usr/bin/nft flush ruleset 2>/dev/null
echo ":: Flushed NFF ruleset."
}
post_remove() {
echo ":: Disabling and removing NFF rulesets (configs untouched unless purging)..."
rm -f /etc/nftables.d/00-nff.nft
echo ":: Disabled and removed old NFF rulesets. nftables is back to using existing rulesets"
/usr/bin/nft -f /etc/nftables.conf
}
|