#!/usr/local/bin/php -q 1) && !empty($argv[1])) { $message = ""; switch ($argv[1]) { case 'block': $message = easyrule_parse_block($argv[2], $argv[3]); break; case 'pass': $message = easyrule_parse_pass($argv[2], $argv[3], $argv[4], $argv[5], $argv[6]); break; } echo $message . "\n"; } else { // Print usage: echo "usage:\n"; echo " Blocking only requires an IP to block\n"; echo " " . basename($argv[0]) . " block \n"; echo "\n"; echo " Passing requires more detail, as it must be as specific as possible. The destination port is optional if you're using a protocol without a port (e.g. ICMP, OSPF, etc).\n"; echo " " . basename($argv[0]) . " pass [destination port]\n"; echo "\n"; echo " Block example:\n"; echo " " . basename($argv[0]) . " block wan 1.2.3.4\n"; echo "\n"; echo " Pass example (protocol with port):\n"; echo " " . basename($argv[0]) . " pass wan tcp 1.2.3.4 192.168.0.4 80\n"; echo "\n"; echo " Block example (protocol without port):\n"; echo " " . basename($argv[0]) . " pass wan icmp 1.2.3.4 192.168.0.4\n"; echo "\n"; } ?>