dnsmasq: fix logic for creating missing files
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 14 Feb 2011 19:42:53 +0000 (19:42 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 14 Feb 2011 19:42:53 +0000 (19:42 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25540 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/dnsmasq/files/dnsmasq.init

index 3e194af..cd5a78a 100644 (file)
@@ -100,10 +100,10 @@ dnsmasq() {
        config_get DOMAIN "$cfg" domain
 
        config_get_bool readethers "$cfg" readethers
-       [ "$readethers" = "1" ] && [ -e "/etc/ethers" ] || touch /etc/ethers
+       [ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers
 
        config_get leasefile $cfg leasefile
-       [ -n "$leasefile" ] && [ -e "$leasefile" ] || touch "$leasefile"
+       [ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile"
        config_get_bool cachelocal "$cfg" cachelocal 1
 
        config_get hostsfile "$cfg" dhcphostsfile