PageRenderTime 24ms CodeModel.GetById 19ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/add_backup_mx_to_existing_domains.php

http://freshdns.googlecode.com/
PHP | 23 lines | 20 code | 3 blank | 0 comment | 0 complexity | c409a4a0cd75d4b45377bf2e8a1024ad MD5 | raw file
 1<?php
 2include_once("config.inc.php");
 3
 4$fallbackHostname = "fallback.example.com";
 5
 6$query = "SELECT *
 7FROM `records`
 8WHERE `type` = 'MX'
 9GROUP BY name
10ORDER BY prio DESC";
11$query = $config['database']->query_slave($query) or die ($config['database']->error());
12while($record = $config['database']->fetch_array($query))
13{
14	try{
15		$manager->addRecord ($record['domain_id'], $record['name'], $record['type'], $fallbackHostname, $record['ttl'], ($record['prio']+10), time());
16	}catch (Exception $ex)
17	{
18		echo $ex->getMessage();
19	}
20	
21	echo $record['name']."\n";
22}
23?>