Esempio n. 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));
}
Esempio n. 2
0
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/
require "guiconfig.inc";
if ($_POST) {
    if ($_POST['clear'] == "Clear") {
        upnp_action('restart');
        $savemsg = "Kurallar temizlendi ve servis yeniden başlatıldı";
    }
}
$rdr_entries = array();
exec("/sbin/pfctl -aminiupnpd -sn", $rdr_entries, $pf_ret);
$now = time();
$year = date("Y");
$pgtitle = "Durum: UPnP Durumu";
include "head.inc";
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php 
include "fbegin.inc";
?>
<p class="pgtitle"><?php 
         killbypid("{$g['varrun_path']}/snmpd.pid");
         break;
     case 'choparp':
         killbyname("choparp");
         break;
     case 'dhcpd':
         killbyname("dhcpd");
         break;
     case 'dhcrelay':
         killbypid("{$g['varrun_path']}/dhcrelay.pid");
         break;
     case 'dnsmasq':
         killbypid("{$g['varrun_path']}/dnsmasq.pid");
         break;
     case 'miniupnpd':
         upnp_action('stop');
         break;
     case 'openntpd':
         killbyname("openntpd");
         break;
     case 'sshd':
         killbyname("sshd");
         break;
     case 'racoon':
         exec("killall -9 racoon");
     default:
         stop_service($_GET['service']);
         break;
 }
 $savemsg = "{$_GET['service']} " . gettext(" durduruldu.");
 sleep(5);