Skip to content

Instantly share code, notes, and snippets.

@chrisshennan
Last active October 7, 2015 08:19
Show Gist options
  • Save chrisshennan/31f59dce6446404418ff to your computer and use it in GitHub Desktop.
Save chrisshennan/31f59dce6446404418ff to your computer and use it in GitHub Desktop.
Ip Updater
<?php
$ipFile = '/tmp/ip.txt';
$username = 'user';
$password = 'pass';
$hostname = 'test.test.com';
$ip = '';
$ip = @file_get_contents('http://wtfismyip.com/text');
$lastIp = @file_get_contents($ipFile);
if($ip && $ip != $lastIp) {
$url = sprintf('https://%s:%s@www.dnsdynamic.org/api/?hostname=%s&myip=%s', $username, $password, $hostname, $ip);
$response = @file_get_contents($url);
print_r($response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment