require_once("config.inc"); require_once("util.inc"); require_once("service-utils.inc"); function usage() { echo "Usage: /usr/local/sbin/pfSsh.php playback maker_fw \n"; } global $g, $config, $argv, $command_split; if (is_array($command_split)) { $args = array_slice($command_split, 2); } else { $args = array_slice($argv, 3); } if (empty($args[0])) { die(usage()); } $interface = $args[0]; preg_match('/^[A-z0-9]+$/', $interface) or die(usage()); #$config['filter'] = array('rule' => array()); $s_list = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '15', '20', '25', '30', '40', '50', '60', '70', '80', '90', '100', '150', '200', '250', '300', '500', '1000'); foreach ($s_list as &$e) { $config['filter']['rule'][] = Array ( 'id' => '', 'tracker' => time(), 'type' => 'pass', 'interface' => $interface, 'ipprotocol' => 'inet', 'tag' => '', 'tagged' => '', 'max' => '', 'max-src-nodes' => '', 'max-src-conn' => '', 'max-src-states' => '', 'statetimeout' => '', 'statetype' => 'keep state', 'os' => '', 'source' => Array ( 'address' => 's' . $e . 'mbit', ), 'destination' => Array ( 'any' => '' ), 'descr' => '', 'dnpipe' => $e . 'mbit_up', 'pdnpipe' => $e . 'mbit_down', 'created' => Array ( 'time' => time(), 'username' => '' ), 'updated' => Array ( 'time' => time(), 'username' => '' ) ); sleep(1); } write_config(); print_r($config['filter']);