aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-12-07 19:16:22 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-12-07 19:16:22 +0000
commita52b68b2da34c284fba266fb971fa8df09d69c7b (patch)
tree7a4f35e01c5bba0b67fe4e6bbfafcf4febb4f965
parent48ead3bd181e6a5ce01ad96564a2f5a8f8531d5a (diff)
downloadpfsense-packages-a52b68b2da34c284fba266fb971fa8df09d69c7b.tar.gz
pfsense-packages-a52b68b2da34c284fba266fb971fa8df09d69c7b.tar.bz2
pfsense-packages-a52b68b2da34c284fba266fb971fa8df09d69c7b.zip
Provision tinydns /etc/tinydns directory upon saving.
-rw-r--r--packages/tinydns/tinydns.inc22
-rw-r--r--packages/tinydns/tinydns.xml6
2 files changed, 17 insertions, 11 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index 4b430ebd..55f5fe69 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -31,11 +31,7 @@
function tinydns_custom_php_install_command() {
global $g, $config;
- conf_mount_rw();
- /* setup daemon tools service area */
- exec("pw useradd Gtinydns");
- exec("pw useradd Gdnslog");
-
+ conf_mount_rw();
$fd = fopen("/usr/local/etc/rc.d/svscan.sh", "w");
$svscan = <<<EOD
@@ -109,11 +105,14 @@ function tinydns_custom_php_deinstall_command() {
function tinydns_custom_php_changeip_command() {
global $g, $config;
conf_mount_rw();
- $ip = $config['installedpackages']['tinydns']['ip'];
- exec("tinydns-conf Gtinydns Gdnslog /etc/tinydns {$ip}");
- exec("ln -s /etc/tinydns /service");
+ $ip = $config['installedpackages']['tinydns']['config'][0]['ipaddress'];
+ /* setup daemon tools service area */
+ exec("/usr/sbin/pw useradd Gtinydns");
+ exec("/usr/sbin/pw useradd Gdnslog");
+ exec("/usr/local/bin/tinydns-conf Gtinydns Gdnslog /etc/tinydns {$ip}");
+ exec("/bin/ln -s /etc/tinydns /service");
sleep(5);
- exec("svstat /service/tinydns");
+ exec("/usr/local/bin/svstat /service/tinydns");
conf_mount_ro();
}
@@ -121,8 +120,9 @@ function tinydns_create_zone_file() {
global $g, $config;
conf_mount_rw();
$fd = fopen("/service/tinydns/root/data", "w");
- foreach($config['installedpackages']['tinydnsdomains'] as $domain)
- fwrite($fd, $domain['recordtype'] . ":" . $domain['hostname'] . "\n");
+ if($config['installedpackages']['tinydnsdomains'])
+ foreach($config['installedpackages']['tinydnsdomains'] as $domain)
+ fwrite($fd, $domain['recordtype'] . ":" . $domain['hostname'] . "\n");
fclose($fd);
/* tell tinydns to reload zone file */
exec("cd /service/tinydns/root && /usr/local/bin/tinydns-data");
diff --git a/packages/tinydns/tinydns.xml b/packages/tinydns/tinydns.xml
index 9be7225a..534ae751 100644
--- a/packages/tinydns/tinydns.xml
+++ b/packages/tinydns/tinydns.xml
@@ -36,6 +36,12 @@
<custom_php_deinstall_command>
tinydns_custom_php_deinstall_command();
</custom_php_deinstall_command>
+ <custom_php_resync_config_command>
+ tinydns_custom_php_changeip_command();
+ tinydns_custom_php_install_command();
+ tinydns_custom_php_changeip_command();
+ tinydns_create_zone_file();
+ </custom_php_resync_config_command>
<include_file>/usr/local/pkg/tinydns.inc</include_file>
<fields>
<field>