Page 1 of 1

Script to list all web domains, mail domains, databases on the server

Posted: Fri Jul 26, 2019 8:04 am
by plutocrat
Hi,

I had to write this for a client with a load of users and sites, so I thought I'd just release it here. Its not particularly well written or formatted, but it just lists the info I needed in a single command, and it might save someone some time. Feel free to improve upon it, or suggest additional info.

Code: Select all

#!/bin/bash

for USER in $( v-list-users plain | awk '{print $1}' )
do
	COUNTWEB=$(v-list-web-domains $USER plain | awk '{print $1}' | wc -l )
	COUNTMAIL=$(v-list-mail-domains $USER plain | awk '{print $1}' | wc -l )
	COUNTDB=$(v-list-databases $USER plain | awk '{print $1}' | wc -l )

	echo "======== $USER ======== "
	echo "  -- Web Domains ($COUNTWEB): --"
	v-list-web-domains $USER plain | awk '{print $1}'
	echo "  -- Mail Domains ($COUNTMAIL): --"
	v-list-mail-domains $USER plain | awk '{print $1}'
	echo "  -- Databases ($COUNTDB): --"
	v-list-databases $USER plain | awk '{print $1}'
	echo ""
done

Re: Script to list all web domains, mail domains, databases on the server

Posted: Fri Jul 26, 2019 8:02 pm
by tlozano
Thank you.

Re: Script to list all web domains, mail domains, databases on the server

Posted: Sat Jul 27, 2019 6:27 pm
by samanthaa
This is great and very useful for me, thanks!