Script to change IP address of all the accounts

by Manoj 2012-04-21 15:33:52

How to change IP address of all the accounts on a cPanel server?

The Change Site IP Address option is WHM is not feasible in case you need to change IP address of all the accounts on a server. In order to change IP address of all the domains on a cPanel server, you have to use the swapip script provided by cPanel.

The following script will do the needful:

for i in cat /etc/trueuserdomains | cut -d: -f1
do
/usr/local/cpanel/bin/swapip OLDIP NEWIP $i;
done;

where,

OLDIP is the current IP assigned to the domain.
NEWIP is the new IP which you would like to assign.
$i is the domain names read per line from the /etc/trueuserdomains file.

Tagged in:

886
like
0
dislike
0
mail
flag

You must LOGIN to add comments