diff --git a/bin/vmail-forwards-add.sh b/bin/vmail-forwards-add.sh index e2d97c8..8b07fe1 100755 --- a/bin/vmail-forwards-add.sh +++ b/bin/vmail-forwards-add.sh @@ -113,11 +113,11 @@ elif [ "$mbox_id" -gt '0' ]; then vm_forwards_id=`eval $dbcmd $dbcmdopts \"$dbquery\"` if [ -z $vm_forwards_id ]; then # existing forward does not exist, add it now - dbcommand="INSERT INTO vm_forwards SET mbox_id='$mbox_id', forward_to='$forward_to'" - if [ -n $save_local ]; then + dbquery="INSERT INTO vm_forwards SET mbox_id='$mbox_id', forward_to='$forward_to'" + if [ ! -z $save_local ]; then dbquery="$dbquery, save_local='$save_local'" fi - echo $dbcmd $dbcmdopts \"$dbquery;\" + eval $dbcmd $dbcmdopts \"$dbquery\;\" else echo "ERROR: Forward for $email already exists. To change either del then add or use mod script." exit 1 diff --git a/bin/vmail-forwards-del.sh b/bin/vmail-forwards-del.sh index a60a1ea..06cb16d 100755 --- a/bin/vmail-forwards-del.sh +++ b/bin/vmail-forwards-del.sh @@ -48,7 +48,6 @@ while getopts "h" opt; do h ) help exit;; - ;; \? ) echo "Invalid option: $OPTARG" 1>&2 exit;;