Simple way to change reseller IP from shell? [Partially Solved]
A reseller with more than fifty resold accounts wants a static IP and wants all of his domains on it. The UI for this is rather onerous; can anyone direct me to the relevant scripts for accomplishing this without half an hour of mouse-clicking? Thanks.
Partial Solution:
Change reseller's shared IP in WHM (still not sure how to get that into a script), then:
I'm going to clean it up a bit more, but you get the gist.
And the question remains: How can I automate this entirely?
A reseller with more than fifty resold accounts wants a static IP and wants all of his domains on it. The UI for this is rather onerous; can anyone direct me to the relevant scripts for accomplishing this without half an hour of mouse-clicking? Thanks.
Partial Solution:
Change reseller's shared IP in WHM (still not sure how to get that into a script), then:
Code:
#!/usr/bin/env bash
RESELLER=$1
OLDIP=$2
NEWIP=$3
for I in $(grep " $RESELLER" /etc/trueuserowners|cut -f1 -d:);do
if grep -q "$OLDIP" /var/cpanel/users/$I;then
echo "$I..."
/usr/local/cpanel/bin/setsiteip -u $I $NEWIP
fi
done
And the question remains: How can I automate this entirely?
Last edited: