Updating options for update_quota_mail.sh script
This commit is contained in:
parent
d37d906ff5
commit
a456a545b0
|
@ -23,7 +23,7 @@ do
|
||||||
if [[ ! "$OPTARG" =~ ^[^\@]*@[^\@]*$ ]] ; then
|
if [[ ! "$OPTARG" =~ ^[^\@]*@[^\@]*$ ]] ; then
|
||||||
showhelp "bad mail address provided"
|
showhelp "bad mail address provided"
|
||||||
fi
|
fi
|
||||||
if [[! "$(mysql_query "select userdb_home from dovecot_view where user = '$OPTARG'")" ]]; then
|
if [[ ! "$(mysql_query "select userdb_home from dovecot_view where user = '$OPTARG'")" ]]; then
|
||||||
showhelp "non existant mail address"
|
showhelp "non existant mail address"
|
||||||
fi
|
fi
|
||||||
maildirs=$(mysql_query "select userdb_home from dovecot_view where user = '$OPTARG'")
|
maildirs=$(mysql_query "select userdb_home from dovecot_view where user = '$OPTARG'")
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue