function StartBubble() { $q = new mysql(); if (!$q->test_mysql_connection()) { echo "Starting......: " . date("H:i:s") . " Postfix Bubble Mysql is not ready aborting...\n"; return; } $ip = new iptables_exec(); $ip->buildrules(); }
if ($argv[1] == "--dns") { iprulesDNS(); exit; } $unix = new unix(); $sock = new sockets(); $pidfile = "/etc/artica-postfix/" . basename(__FILE__) . ".pid"; if ($unix->process_exists(@file_get_contents($pidfile), basename(__FILE__))) { echo "Starting......: " . date("H:i:s") . " iptables configurator already executed PID " . @file_get_contents($pidfile) . "\n"; die; } $pid = getmypid(); echo "Starting......: " . date("H:i:s") . " iptables configurator running {$pid}\n"; file_put_contents($pidfile, $pid); $ip = new iptables_exec(); $ip->buildrules(); function iprulesDNS() { $unix = new unix(); $IPCHAIN = "dnsfilter"; $pidfile = "/etc/artica-postfix/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid"; if ($unix->process_exists(@file_get_contents($pidfile), basename(__FILE__))) { echo "Starting......: " . date("H:i:s") . " iptables configurator already executed PID " . @file_get_contents($pidfile) . "\n"; die; } $pid = getmypid(); file_put_contents($pidfile, $pid); $sock = new sockets(); $EnableIptablesDNS = $sock->GET_INFO("EnableIptablesDNS"); if (!is_numeric($EnableIptablesDNS)) { $EnableIptablesDNS = 1;