aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-03-24 22:12:58 +0000
committerErmal <eri@pfsense.org>2010-03-24 22:12:58 +0000
commit808bf684dbce12ddefcfb995d26f2a4fabb612d3 (patch)
treed27f709dd1149bf8589a9135d112fc74979e4649
parent49d68e26c28919e536834a9204ec8e062b7c89ad (diff)
downloadpfsense-packages-808bf684dbce12ddefcfb995d26f2a4fabb612d3.tar.gz
pfsense-packages-808bf684dbce12ddefcfb995d26f2a4fabb612d3.tar.bz2
pfsense-packages-808bf684dbce12ddefcfb995d26f2a4fabb612d3.zip
Ticket #448. Cleanup before re-writing the configuration.
-rw-r--r--config/tinydns/tinydns.inc8
1 files changed, 3 insertions, 5 deletions
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc
index b9fa3852..b86d7779 100644
--- a/config/tinydns/tinydns.inc
+++ b/config/tinydns/tinydns.inc
@@ -197,6 +197,7 @@ function tinydns_custom_php_changeip_command() {
exec("/bin/cp /var/etc/resolv.conf /var/etc/resolv.conf.original");
exec("/bin/cp /var/etc/resolv.conf /var/etc/resolv.conf.dnscache");
exec("echo domain {$config['system']['domain']} > /var/etc/resolv.conf");
+ exec("rm -rf /etc/dnscache* /service/dnscache*");
foreach ($interfaces as $dnsidx => $dnsif) {
$dnscacheif = convert_friendly_interface_to_real_interface_name($dnsif);
$dnscacheip = find_interface_ip($dnscacheif);
@@ -206,12 +207,9 @@ function tinydns_custom_php_changeip_command() {
$ipmask = $config['interfaces'][$dnsif]['subnet'];
$arr = tinydns_get_ip_subnet_arpa($dnscacheip, $ipmask);
$dnsuserip = $arr[0];
- if(!is_dir("/etc/dnscache{$dnsidx}")) {
- exec("mkdir /etc/dnscache{$dnsidx}");
- exec("/bin/ln -s /etc/dnscache{$dnsidx} /service/");
-
- }
+ exec("mkdir /etc/dnscache{$dnsidx}");
exec("/usr/local/bin/dnscache-conf Gdnscache Gdnslog /etc/dnscache{$dnsidx} {$dnscacheip}");
+ exec("/bin/ln -s /etc/dnscache{$dnsidx} /service/");
if (!is_dir("/etc/dnscache{$dnsidx}/env/IP"))
exec("mkdir -p /etc/dnscache{$dnsidx}/env");
exec("echo {$dnscacheip} > /etc/dnscache{$dnsidx}/env/IP");