Last active
October 7, 2015 08:19
-
-
Save chrisshennan/31f59dce6446404418ff to your computer and use it in GitHub Desktop.
Ip Updater
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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:%[email protected]/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