Просмотр исходного кода

Changed paths to freebsd, and changed to use service unbound restart

Dennis Juhler Aagaard 5 лет назад
Родитель
Сommit
c9b618b284
2 измененных файлов с 4 добавлено и 5 удалено
  1. 3 4
      daemon/dns_runner.php
  2. 1 1
      daemon/dns_runner.service

+ 3 - 4
daemon/dns_runner.php

@@ -17,12 +17,11 @@
             exec("cp {$path}/../data/unbound.conf.d/* /etc/unbound/unbound.conf.d/");
 
             # Keep root.hints reasonbly up to date without being obnoxious
-            if (!file_exists("/etc/unbound/root.hints") || ((time() - filemtime("/etc/unbound/root.hints")) > ($refresh_root_hint_days * 86400))){
-                system("curl -o /etc/unbound/root.hints https://www.internic.net/domain/named.cache");
+            if (!file_exists("/usr/local/etc/unbound/root.hints") || ((time() - filemtime("/usr/local/etc/unbound/root.hints")) > ($refresh_root_hint_days * 86400))){
+                system("curl -o /usr/local/etc/unbound/root.hints https://www.internic.net/domain/named.cache");
             }
 
-            system("systemctl restart unbound");
+            system("service unbound restart");
         }
         sleep(5);
     }
-

+ 1 - 1
daemon/dns_runner.service

@@ -7,7 +7,7 @@ Type=simple
 Restart=always
 RestartSec=1
 User=root
-ExecStart=/usr/bin/env php /var/www/dnsgui/daemon/dns_runner.php
+ExecStart=/usr/bin/env php /usr/local/www/dnsgui/daemon/dns_runner.php
 
 [Install]
 WantedBy=multi-user.target