Пример #1
0
if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["DEBUG"]=true;$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);}
if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");}
include_once(dirname(__FILE__) . '/ressources/class.users.menus.inc');
include_once(dirname(__FILE__) . '/ressources/class.sockets.inc');
include_once(dirname(__FILE__) . '/framework/class.unix.inc');
include_once(dirname(__FILE__) . '/framework/frame.class.inc');
include_once(dirname(__FILE__) . '/ressources/class.iptables-chains.inc');



if(preg_match("#--reload#",implode(" ",$argv))){$GLOBALS["RELOAD"]=true;}
if(preg_match("#--force#",implode(" ",$argv))){$GLOBALS["FORCE"]=true;}



if($argv[1]=='--build-server'){build_server_mode();die();}
if($argv[1]=='--build-client'){build_client_mode();die();}
if($argv[1]=='--auth-logs'){authlogs();sessions_logs();die();ipblocks();}
if($argv[1]=='--authfw'){authfw();sessions_logs();die();ipblocks();}
if($argv[1]=='--authfw-compile'){compile_sshd_rules();sessions_logs();ipblocks();die();}
if($argv[1]=='--snort'){snort_logs();sessions_logs();ipblocks();die();}
if($argv[1]=='--sessions'){sessions_logs();die();}
if($argv[1]=='--loadavg'){loadavg_logs();die();}
if($argv[1]=='--ipblocks'){ipblocks();die();}




function build_server_mode(){
	$sock=new sockets();
	$ActAsASyslogServer=$sock->GET_INFO("ActAsASyslogServer");
Пример #2
0
        system_admin_events("OVERLOADED system: {$GLOBALS["SYSTEM_INTERNAL_LOAD"]}, aborting", __FUNCTION__, __FILE__, __LINE__, "system");
        die;
    }
}
if ($GLOBALS["VERBOSE"]) {
    echo __LINE__ . " TRUE\n";
}
if (!isset($argv[1])) {
    $argv[1] = "--auth-logs";
}
if ($argv[1] == '--restart-syslog') {
    restart_syslog();
    die;
}
if ($argv[1] == '--build-server') {
    build_server_mode();
    die;
}
if ($argv[1] == '--build-client') {
    build_client_mode();
    die;
}
if ($argv[1] == '--haproxy') {
    haproxy_events();
    die;
}
if ($argv[1] == '--squid-notifs') {
    squid_admin_notifs_check();
    die;
}
if ($argv[1] == '--squid-mysql') {