2009-03-11 14:50:24 +00:00
|
|
|
#!/usr/bin/php
|
2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
|
|
|
|
2010-02-27 14:44:38 +00:00
|
|
|
include("includes/defaults.inc.php");
|
2009-03-11 14:50:24 +00:00
|
|
|
include("config.php");
|
|
|
|
include("includes/functions.php");
|
|
|
|
|
|
|
|
# Remove a host and all related data from the system
|
|
|
|
|
|
|
|
if($argv[1] && $argv[2]) {
|
|
|
|
$host = strtolower($argv[1]);
|
|
|
|
$id = getidbyname($host);
|
|
|
|
if($id) {
|
|
|
|
renamehost($id, $argv[2]);
|
|
|
|
echo("Renamed $host\n");
|
|
|
|
} else {
|
|
|
|
echo("Host doesn't exist!\n");
|
|
|
|
}
|
|
|
|
} else {
|
2009-03-17 20:26:29 +00:00
|
|
|
echo("Host Rename Tool\nUsage: ./renamehost.php <old hostname> <new hostname>\n");
|
2009-03-11 14:50:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|