cPanel sunucularda otomatik olarak Mail IP Adresini değiştiren bir bash script'e rastladım. Bu scripti bağlaşmak istedim. Crontab a ekleyip kullanabilirsiniz :)
#!/bin/bash
# Exim Outgoing IP address rotator
# The cPanel Admin 5/9/11
# Files: /etc/mailipaddrpool : list of IP addresses to use for mail
ipfile=/etc/mailipaddrpool
curip=$(grep "*:" /etc/mailips |awk '{print $2}')
if [[ "$curip" == "" ]] || ! grep $curip $ipfile >/dev/null ; then
curip=$(tail -1 $ipfile)
fi
nextipct=$(cat $ipfile |grep -A 1 $curip |wc -l)
if [ "$nextipct" == "1" ];then
nextip=$(head -1 $ipfile)
else
nextip=$(cat $ipfile |grep -A 1 $curip | tail -1)
fi
sed '/*:/d' -i /etc/mailips
sed '/^$/d' -i /etc/mailips
echo "*: $nextip" >> /etc/mailips
30 Kasım 2015