How to find out the reseller name with domains?
Ans :
If you want to list all cPanel accounts under a specific reseller, then you can use the below simple shell script.
1) Crete the file reseller.sh and add the following code.
vi /home/reseller.sh
==========================================================
#!/bin/bash
usage()
{
echo "Example : $0 domain.com or username"
exit 1
}
test $1 || usage
USERN=$(grep $1 "/etc/userdomains" | awk '{print $NF}' | awk 'NR==1')
if [[ -z $USERN ]]
then
echo -e "\e[1;33m $1 is not a reseller \e[0m"
exit 1
fi
OWNER=`cut -d: -f1 /var/cpanel/resellers | grep -o $USERN`
exitstatus=$?
if [ "$exitstatus" == 0 ] ; then
echo "=========================================================="
echo -e "\e[1;31m Below are the accounts associated with the reseller $name \e[0m"
echo "=========================================================="
output=$(for i in `grep $OWNER /var/cpanel/users/* -l` ; do grep USER= $i ; done | awk -F"=" '{ print $2 }')
echo -e "\e[1;33m $output \e[0m"
else
echo -e "\e[1;35m $1 is not a Reseller \e[0m"
exit
fi
==========================================================
2) chmod 755 /home/reseller.sh
3) cd /home/
4)root@server[#] ./reseller resellerusername
or
root@server[#] ./reseller resellerdomain.com
After executing the script you will get the below output as ::
root@server[#] ./reseller indianwebportal.com
==========================================================
Below are the accounts associated with the reseller
==========================================================
test
raj
sunil
or
root@server[#] ./reseller newtest
newtest is not a reseller
That’s all.
In today's digital landscape, timing is everything. Whether you're a social media manager, business owner, or content creator, the success…
Are you a website owner? Maintaining the website is the prime concern for any website owner. Yes, it’s equally important…
If you’ve planned to launch a WordPress website, you might get a question, “How do I log in to WordPress?”…
As the demand for virtual private servers (VPS) continues to grow, businesses and individuals are faced with a crucial decision:…
Web hosting is a large industry, as many other factors help any web hosting provider to form a company. The…