Last active
February 17, 2020 12:34
-
-
Save spicydog/0cce874e840e1f844395 to your computer and use it in GitHub Desktop.
PHP Script for updating ip for no-ip DDNS and example script for crontab
This file contains 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
# Update no-ip ip every one hour | |
0 * * * * curl "YOUR_HOST_URL/noip-updater.php" > /dev/null 2>&1 |
This file contains 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 | |
$user = 'NP-IP USERNAME'; | |
$pass = 'NO-IP PASSWORD'; | |
$host = 'NO-IP HOSTNAME'; | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$url = "http://$user:$pass@dynupdate.no-ip.com/nic/update?hostname=$host&myip=$ip"; | |
echo $result = file_get_contents($url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment