From e429663435443ce49293c6ff1b456371dca2ffc2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 15 Apr 2018 12:10:55 +0100 Subject: [PATCH] Create directory if needed --- src/freedombone-utils-firewall | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/freedombone-utils-firewall b/src/freedombone-utils-firewall index fc1ff62f..06d2f98e 100755 --- a/src/freedombone-utils-firewall +++ b/src/freedombone-utils-firewall @@ -36,6 +36,9 @@ EXTERNAL_IPV4_ADDRESS= function save_firewall_settings { iptables-save > /etc/firewall.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 '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