Add script get_mail_domains.sh
This commit is contained in:
parent
56176a3c8b
commit
118959fab1
18
get_mail_domains.sh
Executable file
18
get_mail_domains.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
mysql=false
|
||||
mysql_credentilas="--login-path=local"
|
||||
mysql_db=postfix
|
||||
|
||||
echo ""
|
||||
if $mysql ; then
|
||||
domains=$(mysql $mysql_credentilas $mysql_db -N -s -e "SELECT domain FROM domain ORDER by domain")
|
||||
else
|
||||
domains=$(su - postgres -c"psql postfix -t -q -c\"SELECT domain FROM domain ORDER by domain\"")
|
||||
fi
|
||||
echo -e "$domains"
|
||||
echo ""
|
||||
|
||||
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user