View Single Post
  #8  
Old 26th July 2008, 01:06
BorderAmigos BorderAmigos is offline
Senior Member
 
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 33 Times in 31 Posts
Send a message via MSN to BorderAmigos Send a message via Yahoo to BorderAmigos
Default

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.).
__________________
System6Hosting.com, ISPConfig 3, Debian.

Last edited by BorderAmigos; 26th July 2008 at 01:08.
Reply With Quote