aboutsummaryrefslogtreecommitdiffstats
path: root/config/tinydns/tinydns.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-03-29 14:07:05 +0000
committerErmal <eri@pfsense.org>2010-03-29 14:07:05 +0000
commitde63d61d87a69b595425eea801fd0a30d255a469 (patch)
tree219648add020db5038f683d668f2940d16e34a32 /config/tinydns/tinydns.inc
parent56619cc2b97abef4248ea2058fe17c814c20238d (diff)
downloadpfsense-packages-de63d61d87a69b595425eea801fd0a30d255a469.tar.gz
pfsense-packages-de63d61d87a69b595425eea801fd0a30d255a469.tar.bz2
pfsense-packages-de63d61d87a69b595425eea801fd0a30d255a469.zip
Ticket #403. More improvements from patches provided here.
Diffstat (limited to 'config/tinydns/tinydns.inc')
-rw-r--r--config/tinydns/tinydns.inc31
1 files changed, 25 insertions, 6 deletions
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc
index ba616846..de4ea302 100644
--- a/config/tinydns/tinydns.inc
+++ b/config/tinydns/tinydns.inc
@@ -111,8 +111,6 @@ svscan_start () {
svscan_stop_post () {
echo "Stopping svscan."
find -L "\$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d \( \! -path "\$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 /usr/local/bin/svc -dx
- PIDTOKILL=`cat /var/run/ping_hosts.pid`
- kill $PIDTOKILL
}
run_rc_command "\$1"
@@ -121,12 +119,33 @@ EOD;
fwrite($fd, $svscan);
fclose($fd);
- conf_mount_ro();
- filter_configure();
+ $filename = "tinydns.sh";
+ $start = "/usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDPHP
+<?php
+ require_once(\"/usr/local/pkg/tinydns.inc\");
tinydns_custom_php_changeip_command();
-
- exec("/usr/local/etc/rc.d/svscan.sh start");
+ tinydns_create_zone_file();
+ tinydns_setup_ping_items();
+?>
+ENDPHP\n";
+
+ $stop = <<<ENDSH
+ svc -dx /var/run/service/tinydns
+ /bin/rm -f /var/run/service/tinydns
+ PIDTOKILL=`cat /var/run/ping_hosts.pid`
+ kill \$PIDTOKILL
+ENDSH;
+
+ write_rcfile(array(
+ "file" => $filename,
+ "start" => $start,
+ "stop" => $stop
+ )
+ );
+
+ conf_mount_ro();
+ filter_configure();
}
function tinydns_custom_php_deinstall_command() {