Updating options for update_quota_mail.sh script

This commit is contained in:
Squidly 2014-07-31 15:32:47 +02:00
parent d37d906ff5
commit a456a545b0
1 changed files with 42 additions and 43 deletions

View File

@ -32,7 +32,7 @@ do
# Expecting a domain # Expecting a domain
# Check if domain is well-formed # Check if domain is well-formed
if [[ ! "$OPTARG" =~ ^[a-z\-]+(\.[a-z\-]+)+$ ]] ; then if [[ ! "$OPTARG" =~ ^[a-z0-9\-]+(\.[a-z\-]+)+$ ]] ; then
showhelp "bad domain provided" showhelp "bad domain provided"
fi fi
@ -46,7 +46,7 @@ do
;; ;;
"c") "c")
# An account # An account
if [[! "$OPTARG" =~ ^[a-z]*$ ]] ; then if [[! "$OPTARG" =~ ^[a-z0-9]*$ ]] ; then
showhelp "bad account provided" showhelp "bad account provided"
fi fi
if [[! "$(mysql_query "select domaine from domaines where domaine = '$1'")" ]]; then if [[! "$(mysql_query "select domaine from domaines where domaine = '$1'")" ]]; then
@ -101,4 +101,3 @@ for i in $maildirs ; do
mysql_query "UPDATE mailbox SET messages=$mail_count WHERE path='$i' ; " mysql_query "UPDATE mailbox SET messages=$mail_count WHERE path='$i' ; "
done done