Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $SNIP1 = "1234";
- $SNIP2 = "1234";
- $curip = dns_get_record("cag.nightwire.de")[0]["ip"];
- $ipalive = "";
- function Connect($ip) {
- $serverConn = @stream_socket_client("tcp://{$ip}:443", $errno, $errstr);
- if ($errstr != '') {
- return false;
- }
- fclose($serverConn);
- return true;
- }
- if(Connect($SNIP1)){
- echo("SNIP1");
- $ipalive = $SNIP1;
- }elseif(Connect($SNIP2)){
- echo("SNIP2");
- $ipalive = $SNIP2;
- }
- if($ipalive != $curip){
- $url = "https://ddns.do.de/?username=XXXXX&password=XXXXXXX&hostname=XXXXXXXXXXXX&myip=" . $ipalive;
- print("Alte IP: {$curip}<br/>Neue IP: {$ipalive}");
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_exec($curl);
- }else{
- print("Update nicht notwendig");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement