From ca1e18068c61b1473a1f66fae7f24f7aede2e09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 19 Mar 2023 14:16:07 +0100 Subject: ipranges.php --- skripti/ipranges.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 skripti/ipranges.php (limited to 'skripti') diff --git a/skripti/ipranges.php b/skripti/ipranges.php new file mode 100755 index 0000000..86fbe43 --- /dev/null +++ b/skripti/ipranges.php @@ -0,0 +1,52 @@ +#!/usr/bin/php + $v) { + if (sizeof($argv) > 1) + if (!in_array(explode(".", $k)[0], $argv)) + continue; + echo "acl $k {\t// {$v['name']}" . PHP_EOL; + foreach ($v["ranges"] as $r) { + echo "\t{$r[1]}; //\t{$r[0]}" . PHP_EOL; + } + echo "};" . PHP_EOL; +} +foreach ($c as $k => $v) { + if (sizeof($argv) > 1) + if (!in_array($k, $argv)) + continue; + echo "acl $k {" . PHP_EOL; + foreach ($v as $a) { + echo "\t$a;\t// {$p[$a]["name"]}" . PHP_EOL; + } + echo "};" . PHP_EOL; +} +$n = str_replace("/", "", str_replace(".", "", array_shift($argv))); +echo "acl $n {" . PHP_EOL; +foreach ($argv as $a) { + echo "\t$a;" . PHP_EOL; +} +echo "};" . PHP_EOL; -- cgit v1.2.3