Where you loop through the accounts and get a list of the subdomains or addon domains.
Otherwise, in command line without using the API, you could do the following:
Code:
or i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ;do awk '/sub_domains/{c=5;next}c{c--;print}' /var/cpanel/userdata/$i/main ;done
This won't show the files it is grabbing, though, to show the accounts. It is pulling the data from /var/cpanel/userdata/username/main where username is the cPanel username by reading the sub_domains portion of the file and returning the lines below it.
This function lists the cPanel account's domains. **Note:** For this function to succeed, the `/var/cpanel/userdata/username/main` file (where `username` represents the authenticated user) **must** possess the correct permissions. If a permissions error occurs, this function returns blank...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.