bundles/pppd: restart nftables if it isn't running

This commit is contained in:
Franzi 2021-06-04 07:20:10 +02:00
parent 1fbc08f74b
commit 8d21e15106
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 12 additions and 2 deletions

View file

@ -3,4 +3,9 @@
rm /etc/nftables-rules.d/90-pppd rm /etc/nftables-rules.d/90-pppd
rm /etc/sysctl.d/90-pppd.conf rm /etc/sysctl.d/90-pppd.conf
if systemctl is-active nftables;
then
systemctl reload nftables systemctl reload nftables
else
systemctl restart nftables
fi

View file

@ -5,6 +5,11 @@ INTERFACE=$1
echo "add rule nat postrouting oif $INTERFACE masquerade" > /etc/nftables-rules.d/90-pppd echo "add rule nat postrouting oif $INTERFACE masquerade" > /etc/nftables-rules.d/90-pppd
echo "net.ipv6.conf.$INTERFACE.accept_ra=2" > /etc/sysctl.d/90-pppd.conf echo "net.ipv6.conf.$INTERFACE.accept_ra=2" > /etc/sysctl.d/90-pppd.conf
if systemctl is-active nftables;
then
systemctl reload nftables systemctl reload nftables
else
systemctl restart nftables
fi
rdisc6 $INTERFACE rdisc6 $INTERFACE