aboutsummaryrefslogtreecommitdiffstats
path: root/config/tinydns/tinydns.inc
diff options
context:
space:
mode:
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() {