From e3468ce8636e07f1585d755c6042734a3d816b5e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Dec 2014 10:36:39 +0000 Subject: [PATCH] Conditions to stop repeated applications --- install-freedombone.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install-freedombone.sh b/install-freedombone.sh index e7aac412..ed294fbd 100755 --- a/install-freedombone.sh +++ b/install-freedombone.sh @@ -7271,8 +7271,12 @@ function enable_wifi_hotspot { echo " dns-nameservers $ROUTER_IP_ADDRESS" >> /etc/network/interfaces fi - sed -i 's/option domain-name "example.org";/#option domain-name "example.org";/g' /etc/dhcp/dhcpd.conf - sed -i 's/option domain-name-servers ns1.example.org, ns2.example.org;/#option domain-name-servers ns1.example.org, ns2.example.org;/g' /etc/dhcp/dhcpd.conf + if ! grep -q '#option domain-name "example.org";' /etc/network/interfaces; then + sed -i 's/option domain-name "example.org";/#option domain-name "example.org";/g' /etc/dhcp/dhcpd.conf + fi + if ! grep -q '#option domain-name-servers ns1.example.org, ns2.example.org;' /etc/network/interfaces; then + sed -i 's/option domain-name-servers ns1.example.org, ns2.example.org;/#option domain-name-servers ns1.example.org, ns2.example.org;/g' /etc/dhcp/dhcpd.conf + fi sed -i 's/#authoritative;/authoritative;/g' /etc/dhcp/dhcpd.conf if ! grep -q "subnet $WIFI_SUBNET netmask 255.255.255.0" /etc/dhcp/dhcpd.conf; then