aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-02-22 20:55:20 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-02-22 20:55:20 +0000
commitd721178df922154350b1625a1db53874dfea8772 (patch)
tree47664cfa16467baf64991fca6ca9659163934664
parent3b01bd5deda5a15108ca9d0f06c877d6b6361622 (diff)
downloadpfsense-packages-d721178df922154350b1625a1db53874dfea8772.tar.gz
pfsense-packages-d721178df922154350b1625a1db53874dfea8772.tar.bz2
pfsense-packages-d721178df922154350b1625a1db53874dfea8772.zip
* Only copy resolv.conf.orig if it exists
* Convert if {} logic to pfSense style * Only operate on dnscache if it exists
-rw-r--r--packages/tinydns/tinydns.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index 39238e45..8b5fc086 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -155,9 +155,8 @@ function tinydns_custom_php_changeip_command() {
exec("echo {$dnsserverip} > /etc/tinydns/env/IP");
exec("/usr/bin/killall -9 tinydns");
- if($config['installedpackages']['tinydns']['config'][0]['enableforwarding'])
- {
- if(!is_dir("/service/dnscache")){
+ if($config['installedpackages']['tinydns']['config'][0]['enableforwarding']) {
+ if(!is_dir("/service/dnscache")) {
exec("/usr/sbin/pw useradd Gdnscache");
exec("/usr/local/bin/dnscache-conf Gdnscache Gdnslog /etc/dnscache {$dnscacheip}");
exec("/bin/ln -s /etc/dnscache /service/");
@@ -172,12 +171,13 @@ function tinydns_custom_php_changeip_command() {
exec("echo domain {$config['system']['domain']} > /var/etc/resolv.conf");
exec("echo nameserver {$dnscacheip} >> /var/etc/resolv.conf");
exec("/usr/bin/killall -9 dnscache");
- }
- else
- {
- exec("/bin/cp /var/etc/resolv.conf.original /var/etc/resolv.conf");
- exec("echo > /etc/dnscache/env/IP");
- exec("/usr/bin/killall -9 dnscache");
+ } else {
+ if(file_exists("/var/etc/resolv.conf.original"))
+ exec("/bin/cp /var/etc/resolv.conf.original /var/etc/resolv.conf");
+ if(is_dir("/etc/dnscache")) {
+ exec("echo > /etc/dnscache/env/IP");
+ exec("/usr/bin/killall -9 dnscache");
+ }
}
conf_mount_ro();
filter_configure();