update_status(gettext("Your rules are up to date..."));
    update_output_window(gettext("You may start Snort now..."));
    exit(0);
}
if ($snort_md5_check_ok == on && $pfsense_md5_check_ok == on && $emergingthreats_url_chk != on) {
    update_status(gettext("Your rules are up to date..."));
    update_output_window(gettext("You may start Snort now..."));
    exit(0);
}
/* You are Not Up to date, always stop snort when updating rules for low end machines */
update_status(gettext("You are NOT up to date..."));
update_output_window(gettext("Stopping Snort service..."));
$chk_if_snort_up = exec("pgrep -x snort");
if ($chk_if_snort_up != "") {
    exec("/usr/bin/touch /tmp/snort_download_halt.pid");
    stop_service("snort");
    sleep(2);
}
/* download snortrules file */
if ($snort_md5_check_ok != on) {
    if (file_exists("{$tmpfname}/{$snort_filename}")) {
        update_status(gettext("Snortrule tar file exists..."));
    } else {
        unhide_progress_bar_status();
        update_status(gettext("There is a new set of Snort rules posted. Downloading..."));
        update_output_window(gettext("May take 4 to 10 min..."));
        //    download_file_with_progress_bar("http://www.mtest.local/pub-bin/oinkmaster.cgi/{$oinkid}/snortrules-snapshot-2.8{$premium_subscriber}.tar.gz", $tmpfname . "/{$snort_filename}", "read_body_firmware");
        download_file_with_progress_bar("http://dl.snort.org/{$premium_url}/snortrules-snapshot-2.8{$premium_subscriber}.tar.gz?oink_code={$oinkid}", $tmpfname . "/{$snort_filename}", "read_body_firmware");
        update_all_status($static_output);
        update_status(gettext("Done downloading rules file."));
        if (150000 > filesize("{$tmpfname}/{$snort_filename}")) {
 $service_enabled = isset($_POST['service_enabled']) ? 1 : 0;
 if ($service_enabled == 1) {
     try {
         $_POST['opt_name'] = htmlentities(str_replace('"', '', $_POST['opt_name']));
         if (empty($_POST['opt_name'])) {
             throw new Exception(_('The name cannot be empty'));
         }
         if ($_POST['wifi_device_id'] == -1) {
             throw new Exception(_('You need to select an associated hotspot'));
         }
     } catch (Exception $e) {
         flash('error', _('PirateBox') . " {$id}: " . $e->getMessage() . ' (' . _('configuration not updated') . ').');
         goto redirect;
     }
 }
 stop_service();
 ynh_setting_set('service_enabled', $service_enabled);
 if ($service_enabled == 1) {
     ynh_setting_set('opt_name', $_POST['opt_name']);
     ynh_setting_set('opt_renaming', isset($_POST['opt_renaming']) ? 1 : 0);
     ynh_setting_set('opt_maxspace', $_POST['opt_maxspace']);
     ynh_setting_set('opt_deleting', isset($_POST['opt_deleting']) ? 1 : 0);
     ynh_setting_set('opt_chat', isset($_POST['opt_chat']) ? 1 : 0);
     ynh_setting_set('wifi_device_id', $_POST['wifi_device_id']);
     $retcode = start_service();
     if ($retcode == 0) {
         flash('success', _('Configuration updated and service successfully reloaded'));
     } else {
         flash('error', _('Configuration updated but service reload failed'));
     }
 } else {
예제 #3
0
        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);
}
/* batch mode, allow other scripts to call this script */
if ($_GET['batch']) {
    exit;
}
$pgtitle = "Durum: Servisler";
include "head.inc";
?>

<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php 
	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_once "guiconfig.inc";
require_once "service-utils.inc";
$logfile = "/var/log/arp.dat";
if ($_POST['clear']) {
    conf_mount_rw();
    stop_service("arpwatch");
    unlink_if_exists($logfile);
    touch($logfile);
    start_service("arpwatch");
    conf_mount_ro();
}
if (file_exists($logfile)) {
    $rawrep = file($logfile);
    foreach ($rawrep as $line) {
        $todo = preg_split('/\\s/', $line);
        $rawmac = explode(":", trim($todo[0]));
        foreach ($rawmac as $set) {
            $mac[] = str_pad($set, 2, "0", STR_PAD_LEFT);
        }
        $newmac = implode(":", $mac);
        $report[$todo[1]][] = array("mac" => $newmac, "timestamp" => trim($todo[2]), "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown");
예제 #5
0
     if ($params['schema_type'] == 1) {
         $solr_schema_attr['uniqueKey'] = $params['uniqueKey'];
         $solr_schema_attr['defaultSearchField'] = $params['defaultSearchField'];
         $solr_schema_attr['defaultOperator'] = $params['defaultOperator'];
     } else {
         $solr_schema_attr = $params['hand_config_schema'];
     }
     update_schema($pdo, $service_id, $solr_schema_attr);
     update_dataimport($pdo, $service_id, $params['dataimport']);
     msg_redirect('service_detail.php?service_id=' . $service_id);
     break;
 case 'stop':
     $username = check_login($def_url);
     $service_id = $params['service_id'];
     if (lock_service($pdo, $service_id)) {
         stop_service($pdo, $service_id);
         foreach ($cfg['lb_host'] as $key => $v) {
             $target_id = $v;
             insert_action_queue_new($pdo, SERVICE_RECONFIGURE, $service_id, $target_id, $username);
             insert_action_queue_new($pdo, SERVICE_RELOAD, $service_id, $target_id, $username);
         }
         if ($cfg["puppet"]["enable"]) {
             insert_action_queue($pdo, XMLRPC_RECONFIGURE, 0, $username);
             insert_action_queue($pdo, XMLRPC_RELOAD, 0, $username);
         }
     }
     service_redirect();
     break;
 case 'start':
     $username = check_login($def_url);
     $service_id = $params['service_id'];