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"); if(!is_numeric($ActAsASyslogServer)){
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') { squid_notifications(); die; } if ($argv[1] == '--load-stats') {