Пример #1
0
function service_control_restart($name, $extras)
{
    switch ($name) {
        case 'radvd':
            services_radvd_configure();
            break;
        case 'ntpd':
            system_ntp_configure();
            break;
        case 'apinger':
            killbypid("/var/run/apinger.pid");
            setup_gateways_monitor();
            break;
        case 'bsnmpd':
            services_snmpd_configure();
            break;
        case 'dhcrelay':
            services_dhcrelay_configure();
            break;
        case 'dhcrelay6':
            services_dhcrelay6_configure();
            break;
        case 'dnsmasq':
            services_dnsmasq_configure();
            break;
        case 'unbound':
            services_unbound_configure();
            break;
        case 'dhcpd':
            services_dhcpd_configure();
            break;
        case 'igmpproxy':
            services_igmpproxy_configure();
            break;
        case 'miniupnpd':
            upnp_action('restart');
            break;
        case 'ipsec':
            vpn_ipsec_force_reload();
            break;
        case 'sshd':
            configd_run("sshd restart");
            break;
        case 'openvpn':
            $vpnmode = htmlspecialchars($extras['vpnmode']);
            if ($vpnmode == "server" || $vpnmode == "client") {
                $id = htmlspecialchars($extras['id']);
                $configfile = "/var/etc/openvpn/{$vpnmode}{$id}.conf";
                if (file_exists($configfile)) {
                    openvpn_restart_by_vpnid($vpnmode, $id);
                }
            }
            break;
        case 'relayd':
            relayd_configure(true);
            break;
        case 'squid':
            configd_run("proxy restart");
            break;
        case 'suricata':
            configd_run("ids restart");
            break;
        default:
            log_error(sprintf(gettext("Could not restart unknown service `%s'"), $name));
            break;
    }
    return sprintf(gettext("%s has been restarted."), htmlspecialchars($name));
}
            $config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns1'];
        }
        if ($_POST['radns2']) {
            $config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns2'];
        }
        if ($_POST['radns3']) {
            $config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns3'];
        }
        $config['dhcpdv6'][$if]['rasamednsasdhcp6'] = $_POST['rasamednsasdhcp6'] ? true : false;
        if (count($pconfig['subnets'])) {
            $config['dhcpdv6'][$if]['subnets']['item'] = $pconfig['subnets'];
        } else {
            unset($config['dhcpdv6'][$if]['subnets']);
        }
        write_config();
        $retval = services_radvd_configure();
        $savemsg = get_std_save_message($retval);
    }
}
$pgtitle = array(gettext("Services"), htmlspecialchars(gettext("DHCPv6 Server & RA")));
if (!empty($if) && isset($iflist[$if])) {
    $pgtitle[] = $iflist[$if];
}
$pgtitle[] = gettext("Router Advertisements");
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
if ($savemsg) {
    print_info_box($savemsg, 'success');
}
Пример #3
0
                 continue;
             }
             if ($vip['mode'] == "ipalias" && substr($vip['interface'], 0, 4) != "_vip") {
                 continue;
             }
             interface_vip_bring_down($vip);
             /*
              * Reconfigure radvd when necessary
              * XXX: Is it the best way to do it?
              */
             if (isset($config['dhcpdv6']) && is_array($config['dhcpdv6'])) {
                 foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) {
                     if ($dhcpv6if !== $vip['interface'] || $dhcpv6ifconf['ramode'] === "disabled") {
                         continue;
                     }
                     services_radvd_configure();
                     break;
                 }
             }
         }
     }
     $savemsg = sprintf(gettext("%s IPs have been disabled. Please note that disabling does not survive a reboot and some configuration changes will re-enable."), $carp_counter);
     $status = 0;
 } else {
     $savemsg = gettext("CARP has been enabled.");
     if (is_array($config['virtualip']['vip'])) {
         $viparr =& $config['virtualip']['vip'];
         foreach ($viparr as $vip) {
             switch ($vip['mode']) {
                 case "carp":
                     interface_carp_configure($vip);