Пример #1
0
                    if (!empty($svrlist)) {
                        $svrlist .= ',';
                    }
                    $svrlist .= $srv[0];
                }
            }
        }
    }
    if (!$input_errors) {
        $config['dhcrelay6']['enable'] = $_POST['enable'] ? true : false;
        $config['dhcrelay6']['interface'] = implode(",", $_POST['interface']);
        $config['dhcrelay6']['agentoption'] = $_POST['agentoption'] ? true : false;
        $config['dhcrelay6']['server'] = $svrlist;
        write_config();
        $retval = 0;
        $retval = services_dhcrelay6_configure();
        $savemsg = get_std_save_message($retval);
    }
}
$pconfig['server'] = $config['dhcrelay6']['server'];
$pgtitle = array(gettext("Services"), gettext("DHCPv6 Relay"));
$shortcut_section = "dhcp6";
include "head.inc";
if ($dhcpd_enabled) {
    echo '<div class="alert alert-danger">' . gettext("DHCPv6 Server is currently enabled. Cannot enable the DHCPv6 Relay service while the DHCPv6 Server is enabled on any interface.") . '</div>';
    include "foot.inc";
    exit;
}
if ($input_errors) {
    print_input_errors($input_errors);
}
Пример #2
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));
}