unquote quota in case of NULL

This commit is contained in:
Matthew Saunders Brown 2021-10-15 16:01:53 -07:00
parent 3302ae6dcc
commit 8cc3a8a109
2 changed files with 5 additions and 6 deletions

View File

@ -44,7 +44,7 @@ if [[ -n $quota ]]; then
# make quota uppercase in case it is set to NULL
quota=`echo $quota | tr [:lower:] [:upper:]`
if [[ "$quota" =~ ^[0-9]+$ ]] || [[ "$quota" == "NULL" ]]; then
dbset=" mbox_quota_default=\"$quota\""
dbset=" mbox_quota_default=$quota"
else
echo "ERROR: quota (-q) must numeric or NULL"
exit 1
@ -59,7 +59,7 @@ if [[ -n $limit ]]; then
if [ ! -z "$dbset" ]; then
dbset="$dbset,"
fi
dbset="$dbset mbox_limit=\"$limit\""
dbset="$dbset mbox_limit=$limit"
else
echo "ERROR: limit (-l) must numeric or NULL"
exit 1

View File

@ -47,7 +47,7 @@ if [ -n "$quota" ]; then
# make quota uppercase in case it is set to NULL
quota=`echo $quota | tr [:lower:] [:upper:]`
if [[ "$quota" =~ ^[0-9]+$ ]] || [[ "$quota" == "NULL" ]]; then
dbset=" quota=\"$quota\""
dbset=" quota=$quota"
else
echo "ERROR: quota (-q) must numeric or NULL"
exit 1
@ -74,9 +74,8 @@ fi
if [ -n "$dbset" ]; then
# build query
dbcmd="mysql --defaults-extra-file=$MYSQL_CONNECTION_INFO_FILE -e 'UPDATE vm_mboxes SET $dbset WHERE mbox.id=\"$mbox_id\";'"
# eval $dbcmd
echo $dbcmd
dbcmd="mysql --defaults-extra-file=$MYSQL_CONNECTION_INFO_FILE -e 'UPDATE vm_mboxes SET $dbset WHERE id=\"$mbox_id\";'"
eval $dbcmd
else