Mass changing sites IP addresses
On BlueQuartz sites can have their own ip address, and this is stored both in the configuration files (such as in /etc/sysconfig/network-scripts/....) and in the BlueQuartz itself internal database.
To modify all the ip addresses on the machine you can
1) Modify each site in the control panel (very slow)
2) Create a script that does this task for you (this is our solution
The solution
Well log in the server as root and create a new file called mass-change.pl. We do this by typing
pico mass-change.plthen enter the following lines
#!/usr/bin/perl -w$lines = `clistvsite`;
@all_lines = split("\n", $lines);
foreach $line (@all_lines)
{
@line_parts = split("\t",$line);
$domain = $line_parts[0];
print $domain."\t\t";
$command = `cmodvsite --fqdn="$domain" --ipaddr=THE_IP_YOU_WANT`;
print "\n";
}
replace the placeholder THE_IP_YOU_WANT with the new value of the ip address. Save the file and then type:
chmod 700 mass-change.plYou can now run the script:
./mass-change.pl