fix type cvs -> csv
This commit is contained in:
parent
20bf1743c0
commit
b263a75471
|
@ -20,7 +20,7 @@ help()
|
|||
echo " -a Return info for specific alias."
|
||||
echo " -e Return all aliases for specified email address."
|
||||
echo " -d Return all aliases for specified domain."
|
||||
echo " -c Output in cvs format."
|
||||
echo " -c Output in csv format."
|
||||
echo " -t Use tabs instead of tables for output, do not display column headers."
|
||||
echo ""
|
||||
echo " Search term is optional. If nothing specified all aliases for all email acccounts for all domains will be returned."
|
||||
|
@ -61,4 +61,4 @@ fi
|
|||
dbquery="$dbquery ORDER BY domain, mbox, alias;";
|
||||
|
||||
# execute mysql query
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv
|
||||
|
|
|
@ -19,7 +19,7 @@ help()
|
|||
echo " -h Print this help."
|
||||
echo " -e <email> Email address to get autresonder for."
|
||||
echo " -d <domain> Domain to get all autoresponders for."
|
||||
echo " -c Output in cvs format."
|
||||
echo " -c Output in csv format."
|
||||
echo " -t Use tabs instead of tables for output, do not display column headers."
|
||||
echo ""
|
||||
echo " Search term is optional. If nothing specified all forwards for all email acccounts for all domains will be returned."
|
||||
|
@ -53,4 +53,4 @@ fi
|
|||
# sort results
|
||||
dbquery="$dbquery ORDER BY domain, mbox"
|
||||
# execute mysql query
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv
|
||||
|
|
|
@ -17,7 +17,7 @@ help()
|
|||
echo "usage: $thisfilename [-c] [-h]"
|
||||
echo ""
|
||||
echo " -h Print this help."
|
||||
echo " -c Output in cvs format."
|
||||
echo " -c Output in csv format."
|
||||
echo
|
||||
echo " Returns defaults configured in the vm_domains table schema."
|
||||
exit
|
||||
|
@ -30,25 +30,25 @@ dbcmdopts="-s -N -e"
|
|||
|
||||
# get "status" default
|
||||
dbquery="SELECT COLUMN_DEFAULT FROM information_schema.columns WHERE TABLE_SCHEMA = 'vmail' AND TABLE_NAME = 'vm_domains' AND COLUMN_NAME = 'status'"
|
||||
status=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs`
|
||||
status=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv`
|
||||
|
||||
# get "mbox_limit" default
|
||||
dbquery="SELECT COLUMN_DEFAULT FROM information_schema.columns WHERE TABLE_SCHEMA = 'vmail' AND TABLE_NAME = 'vm_domains' AND COLUMN_NAME = 'mbox_limit'"
|
||||
mbox_limit=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs`
|
||||
mbox_limit=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv`
|
||||
|
||||
# get "mbox_quota_default" default
|
||||
dbquery="SELECT COLUMN_DEFAULT FROM information_schema.columns WHERE TABLE_SCHEMA = 'vmail' AND TABLE_NAME = 'vm_domains' AND COLUMN_NAME = 'mbox_quota_default'"
|
||||
mbox_quota_default=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs`
|
||||
mbox_quota_default=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv`
|
||||
|
||||
# get "mbox_ratelimit_default" default
|
||||
dbquery="SELECT COLUMN_DEFAULT FROM information_schema.columns WHERE TABLE_SCHEMA = 'vmail' AND TABLE_NAME = 'vm_domains' AND COLUMN_NAME = 'mbox_ratelimit_default'"
|
||||
mbox_ratelimit_default=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs`
|
||||
mbox_ratelimit_default=`eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv`
|
||||
|
||||
# create newline var
|
||||
NL=$'\n'
|
||||
output="status mbox_limit mbox_quota_default mbox_ratelimit_default${NL}$status $mbox_limit $mbox_quota_default $mbox_ratelimit_default"
|
||||
|
||||
if [[ $cvs ]]; then
|
||||
if [[ $csv ]]; then
|
||||
echo "$output" | tr " " ","
|
||||
else
|
||||
echo "$output" | column -t
|
||||
|
|
|
@ -18,7 +18,7 @@ help()
|
|||
echo ""
|
||||
echo " -h Print this help."
|
||||
echo " -d Domain name to get DKIM info for."
|
||||
echo " -c CVS - Output in cvs format, instead of tabbed table."
|
||||
echo " -c CSV - Output in csv format, instead of tabbed table."
|
||||
echo ""
|
||||
exit
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ if [[ ${#domains[@]} > 0 ]]; then
|
|||
dkim=`cat /etc/ssl/dkim/$domain.dkim`
|
||||
output="$output${NL}$domain $selector $dkim"
|
||||
done
|
||||
if [[ $cvs ]]; then
|
||||
if [[ $csv ]]; then
|
||||
echo "$output" | tr " " ","
|
||||
else
|
||||
echo "$output" | column -t
|
||||
|
|
|
@ -19,7 +19,7 @@ help()
|
|||
echo " -h Print this help."
|
||||
echo " -d Domain to be queried."
|
||||
echo " -g Glob - Wildcard search instead of specific domain search."
|
||||
echo " -c Output in cvs format."
|
||||
echo " -c Output in csv format."
|
||||
echo " -t Use tabs instead of tables for output, do not display column headers."
|
||||
echo ""
|
||||
echo " Domain/Glob is optional. If nothing specified all domains will be queried."
|
||||
|
@ -49,4 +49,4 @@ fi
|
|||
dbquery="$dbquery ORDER BY domain"
|
||||
|
||||
# execute mysql query
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery;\"" $cvs
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery;\"" $csv
|
||||
|
|
|
@ -20,7 +20,7 @@ help()
|
|||
echo " -e <email> Email address to get forwarding for."
|
||||
echo " -f <forward> Return info for specific forward."
|
||||
echo " -d <domain> Get all forwards for specified domain."
|
||||
echo " -c Output in cvs format."
|
||||
echo " -c Output in csv format."
|
||||
echo " -t Use tabs instead of tables for output, do not display column headers."
|
||||
echo ""
|
||||
echo " Search term is optional. If nothing specified all forwards for all email acccounts for all domains will be returned."
|
||||
|
@ -54,4 +54,4 @@ fi
|
|||
dbquery="$dbquery ORDER BY domain, mbox, forward_to;";
|
||||
|
||||
# execute mysql query
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv
|
||||
|
|
|
@ -20,7 +20,7 @@ help()
|
|||
echo " -m <mbox> Return all email accounts, accross all domains, with <mbox> for the local part."
|
||||
echo " -d <domain> Return all email accounts from specified domain."
|
||||
echo " -e <email> Specific email address to search for."
|
||||
echo " -c Output in cvs format."
|
||||
echo " -c Output in csv format."
|
||||
echo " -t Use tabs instead of tables for output, do not display column headers."
|
||||
echo " -v Include encrypt password in output."
|
||||
echo ""
|
||||
|
@ -66,4 +66,4 @@ fi
|
|||
dbquery="$dbquery ORDER BY domain, mbox;";
|
||||
|
||||
# execute mysql query
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $cvs
|
||||
eval $dbcmd $dbcmdopts "\"$dbquery\"" $csv
|
||||
|
|
|
@ -111,8 +111,8 @@ function vmail:getoptions () {
|
|||
b ) # body - Body for Autoresponder emails
|
||||
body="${OPTARG}"
|
||||
;;
|
||||
c ) # cvs - output in cvs format
|
||||
cvs="| sed 's/\t/,/g'"
|
||||
c ) # csv - output in csv format
|
||||
csv="| sed 's/\t/,/g'"
|
||||
;;
|
||||
d ) # domain name (virtualhost) to act on
|
||||
domain=${OPTARG,,}
|
||||
|
|
Loading…
Reference in New Issue
Block a user