mirror of
https://github.com/rekryt/iplist.git
synced 2025-10-13 00:49:36 +03:00
feat: add a new CIDR6 search method
This commit is contained in:
@@ -30,14 +30,27 @@ class IP6Helper {
|
|||||||
|
|
||||||
$search = shell_exec(
|
$search = shell_exec(
|
||||||
implode(' | ', [
|
implode(' | ', [
|
||||||
'whois -a ' . $ip,
|
'whois ' . $ip,
|
||||||
'grep inet6num',
|
'grep CIDR',
|
||||||
'grep -v "/0"',
|
'grep -v "/0"',
|
||||||
'head -n 1',
|
'head -n 1',
|
||||||
"awk '{print $2}'",
|
"awk '{print $2}'",
|
||||||
|
"grep -oE '^([0-9a-fA-F]{1,4}:){1,7}(:|[0-9a-fA-F]{1,4})(:[0-9a-fA-F]{1,4}){0,6}/[0-9]+$'",
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!$search) {
|
||||||
|
$search = shell_exec(
|
||||||
|
implode(' | ', [
|
||||||
|
'whois -a ' . $ip,
|
||||||
|
'grep inet6num',
|
||||||
|
'grep -v "/0"',
|
||||||
|
'head -n 1',
|
||||||
|
"awk '{print $2}'",
|
||||||
|
])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$search) {
|
if (!$search) {
|
||||||
$search = shell_exec(
|
$search = shell_exec(
|
||||||
implode(' | ', [
|
implode(' | ', [
|
||||||
|
Reference in New Issue
Block a user