Created
July 29, 2014 19:20
-
-
Save lucasff/c57f92745b027c8efe41 to your computer and use it in GitHub Desktop.
cPanel on Amazon IP Update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `cat /etc/trueuserdomains | cut -d: -f1` | |
do | |
/usr/local/cpanel/bin/swapip OLDIP NEWIP $i; | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFACE=eth0 | |
OLD_IP=cat /var/cpanel/mainip | |
NEW_IP=`ifconfig $IFACE | grep "inet addr" | awk '{print $2}' | awk -F: '{print $2}'` | |
echo "Subindo a licença do cPanel" | |
ec2-associate-address -i i-169fe60b --region sa-east-1 177.71.252.114 | |
/usr/local/cpanel/cpkeyclt | |
echo -n "Definindo novo IP " | |
echo -n $NEW_IP | |
echo -n " como shared Main IP" | |
echo -n "$NEW_IP" > /var/cpanel/mainip | |
echo "Definindo novo IP como IP de cada conta do sistema" | |
replace $OLD_IP $NEW_IP -- /var/cpanel/userdata/*/* | |
replace $OLD_IP $NEW_IP -- /var/cpanel/users/* | |
echo "Gerando novamente o arquivo httpd.conf" | |
/scripts/rebuildhttpdconf | |
echo "Reiniciando Apache" | |
service httpd restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment