Commit bb98ed39 authored by Franco Fichtner's avatar Franco Fichtner

dns: switch to ports-based unbound; #244

Upgrade path is not for fiddling with the installed files,
we're importing config.xml, not a full base system.
parent 758c6cad
......@@ -107,6 +107,7 @@ CORE_DEPENDS?= apinger \
sudo \
suricata \
syslogd \
unbound \
voucher \
wol \
zip
......
......@@ -388,21 +388,22 @@ function sync_unbound_service()
}
// Execute commands as the user unbound
function do_as_unbound_user($cmd) {
function do_as_unbound_user($cmd)
{
global $g;
switch ($cmd) {
case "start":
mwexec("/usr/sbin/unbound -c {$g['unbound_chroot_path']}/unbound.conf");
case 'start':
mwexec("/usr/local/sbin/unbound -c {$g['unbound_chroot_path']}/unbound.conf");
break;
case "stop":
mwexec("chroot -u unbound -g unbound / /usr/sbin/unbound-control stop", true);
case 'stop':
mwexec("chroot -u unbound -g unbound / /usr/local/sbin/unbound-control stop", true);
break;
case "unbound-anchor":
mwexec("chroot -u unbound -g unbound / /usr/sbin/unbound-anchor -a {$g['unbound_chroot_path']}/root.key", true);
case 'unbound-anchor':
mwexec("chroot -u unbound -g unbound / /usr/local/sbin/unbound-anchor -a {$g['unbound_chroot_path']}/root.key", true);
break;
case "unbound-control-setup":
mwexec("chroot -u unbound -g unbound / /usr/sbin/unbound-control-setup -d {$g['unbound_chroot_path']}", true);
case 'unbound-control-setup':
mwexec("chroot -u unbound -g unbound / /usr/local/sbin/unbound-control-setup -d {$g['unbound_chroot_path']}", true);
break;
default:
break;
......
......@@ -3346,16 +3346,6 @@ function upgrade_110_to_111()
{
global $config;
/* Make sure unbound user exist */
mwexec('/usr/sbin/pw groupadd -n unbound -g 59', true);
mwexec('/usr/sbin/pw useradd -n unbound -c "Unbound DNS Resolver" -d /var/unbound -s /usr/sbin/nologin -u 59 -g 59', true);
/* cleanup old unbound package stuffs */
@unlink('/usr/local/www/unbound_status.php');
@unlink('/usr/local/www/unbound_acls.php');
@unlink('/usr/local/bin/unbound_monitor.sh');
@unlink('/usr/local/etc/rc.d/unbound.sh');
/* Remove old menu and service entries */
if (isset($config['installedpackages']['menu']) && is_array($config['installedpackages']['menu'])) {
foreach ($config['installedpackages']['menu'] as $idx => $menu) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment