Create directory if needed

This commit is contained in:
Bob Mottram 2018-04-15 12:10:55 +01:00
parent ad964baf77
commit e429663435
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,9 @@ EXTERNAL_IPV4_ADDRESS=
function save_firewall_settings { function save_firewall_settings {
iptables-save > /etc/firewall.conf iptables-save > /etc/firewall.conf
ip6tables-save > /etc/firewall6.conf ip6tables-save > /etc/firewall6.conf
if [ ! -d /etc/network/if-up.d ]; then
mkdir /etc/network/if-up.d
fi
printf '#!/bin/sh\n' > /etc/network/if-up.d/iptables printf '#!/bin/sh\n' > /etc/network/if-up.d/iptables
printf 'iptables-restore < /etc/firewall.conf\n' >> /etc/network/if-up.d/iptables printf 'iptables-restore < /etc/firewall.conf\n' >> /etc/network/if-up.d/iptables
printf 'ip6tables-restore < /etc/firewall6.conf\n' >> /etc/network/if-up.d/iptables printf 'ip6tables-restore < /etc/firewall6.conf\n' >> /etc/network/if-up.d/iptables