Mass Change IP

Menù di navigazione
  • Home
  • Contacts
HOME | Index |

Mass Change IP

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.pl

then 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.pl

You can now run the script:

./mass-change.pl
Labs
  • CentOS + BlueQuartz
  • Installing Spamassassin ClamAv and Mailscanner on Bluequartz
  • SARE Rules & RulesDuJour
  • Installing MRTG
  • Mass Change IP
  • CCED problems
  • Deleting old logfiles
  • POP3 problems
  • Recalculate Quotas
  • How to block an IP address
  • NAMED and DNS
  • PHP
  • Enabling safe mode per-directory
  • Howto install php4 & php5 on Apache2
  • Linux
  • Automating Mysql backups
  • Restoring MySQL dumps
  • Replacing Text In Files
  • Firefox and flash on x86_64
  • Find user's files
  • Lines of code
  • Vsftp with virtual users
  • MSN
  • RandomCase

Home | Contacts | E.R.WEB Official Site