Skip to content

Commit 62373f9

Browse files
author
Kirill
committed
ip from ipify.org
1 parent 450b360 commit 62373f9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cloudflare.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function __construct($argv)
2727

2828
$this->apiKey = (string) $argv[2]; // CF Global API Key
2929
$hostname = (string) $argv[3]; // example: example.com.uk---sundomain.example1.com---example2.com
30-
$this->ip = (string) $argv[4];
30+
$this->ip = (string) $this->getIpAddressIpify();
3131

3232
$this->validateIp($this->ip);
3333

@@ -92,6 +92,12 @@ function validateIp($ip)
9292
}
9393
return true;
9494
}
95+
/*
96+
* get ip from ipify.org
97+
*/
98+
function getIpAddressIpify() {
99+
return file_get_contents('https://api64.ipify.org');
100+
}
95101

96102
/*
97103
* IPv4 = zone A, IPv6 = zone AAAA

0 commit comments

Comments
 (0)