#!/usr/bin/php -q
<?

$changeid=1; //If disabled id's are not changed
$start=25; //We change all reseller id's to +$start
$resellers=30; //Highest reseller id, 30 is normally enough

$dump=`pg_dump -ad --table reseller_info appldb`;
$dump.=`pg_dump -ad --table reseller_bandwidth appldb`;
$dump.=`pg_dump -ad --table reseller_users appldb`;
$dump.=`pg_dump -ad --table reseller_telnet appldb`;
$dump.=`pg_dump -ad --table reseller_ssh appldb`;
$dump.=`pg_dump -ad --table reseller_apache appldb`;
$dump.=`pg_dump -ad --table reseller_diskquota appldb`;
$dump.=`pg_dump -ad --table reseller_ipinfo appldb`;

if($changeid){
	for ($i = $resellers; $i >= 1; $i--) {
   		$j=$i+$start;
   		$dump=str_replace("($i,","($j,",$dump);
	}
}

echo $dump;


?>
