#!/usr/bin/php &$topip) { fwrite($hb, "$baseip - $topip\n"); $rirstat_lines = ipv6_range2cidr($baseip, $topip); foreach ($rirstat_lines as $x) { fwrite($hf, "$x\n"); } } fclose($hb); fclose($hf); rename(DIR . "/out/ipv6_cidr_$rir.new", DIR . "/out/ipv6_cidr_$rir"); rename(DIR . "/out/ipv6_blocks_$rir.new", DIR . "/out/ipv6_blocks_$rir"); } echo "Finished!\n"; ?>