Something like this maybe...???
Code:
<?php
//
// Configuration
//
$dbhost = ''; // MySQL Host Name
$dbuser = ''; // MySQL User Name
$dbpass = ''; // MySQK Password
$remoteip = ''; // Some remote site that will echo your IP address
//
// Update Script
//
$ip = file_get_contents($remoteip);
if ($ip !== false)
{
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
mysql_select_db('db_ispconfig');
$query = "UPDATE dns_isp_dns SET dns_soa_ip = $ip WHERE dns_soa_ip = *";
mysql_query($query) or die('IP update failed.');
$query = "UPDATE dns_a SET ip_adresse = $ip WHERE ip_adresse = *";
mysql_query($query) or die('A update failed.')
$query = "UPDATE dns_isp_dns SET status = 'u' WHERE status = *";
mysql_query($query) or die('DNS update failed.');
mysql_close($conn);
$update = shell_exec('touch /home/admispconfig/ispconfig/.run');
}
else
{
die('Error getting IP address.');
}
?>
I have a remote server that echos the IP using SSI. The intent of this is to update the main external IP and any A records (which I'm using for
www.).