So another thread led me to /etc/domainusers, which is *almost* exactly what I need, except that it contains all the domains in use for each user.
What I need is something I can grep from bash that will return a username *once* with its corresponding main domain.
Or is there a way to query cPanel's setup somehow to return this from bash?
Basically, if you have the username as $user and do
, you get something like
- which is perfect, except you get multiple domains if they have addon domains. I need something that will allow me to only get the primary domain associated with an account.
Any ideas?
What I need is something I can grep from bash that will return a username *once* with its corresponding main domain.
Or is there a way to query cPanel's setup somehow to return this from bash?
Basically, if you have the username as $user and do
Code:
grep ': $user' /etc/userdomains
Code:
example.com: username
Any ideas?