commit 7d7961e5ef459f0618b7e5134a31000329f1cd7c parent f2e868961ec59807df54f56e21a1d96fc87671b9 Author: Petar Yotsev <petar@yotsev.xyz> Date: Tue, 14 Dec 2021 12:19:01 +0000 Fix more if statements Diffstat:
M | files/madduser | | | 6 | +++--- |
M | files/mdeluser | | | 6 | +++--- |
M | files/mpasswd | | | 6 | +++--- |
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/files/madduser b/files/madduser @@ -9,19 +9,19 @@ fi domain=$1 user=$2 -if [ -z $(grep "$domain" /etc/mail/domains 2> /dev/null) ]; then +if [ -z "$(grep "$domain" /etc/mail/domains 2> /dev/null)" ]; then echo "Error: Invalid domain" echo "Info: It should be one of the following:" cat /etc/mail/domains return 1 fi -if [ -n $(grep "$user@$domain" /etc/mail/credentials 2> /dev/null) ]; then +if [ -n "$(grep "$user@$domain" /etc/mail/credentials 2> /dev/null)" ]; then echo "Error: User already exists in /etc/mail/credentials" return 1 fi -if [ -n $(grep "$user@$domain" /etc/mail/virtuals 2> /dev/null) ]; then +if [ -n "$(grep "$user@$domain" /etc/mail/virtuals 2> /dev/null)" ]; then echo "Error: User already exists in /etc/mail/virtuals" return 1 fi diff --git a/files/mdeluser b/files/mdeluser @@ -9,19 +9,19 @@ fi domain=$1 user=$2 -if [ -z $(grep "$domain" /etc/mail/domains 2> /dev/null) ]; then +if [ -z "$(grep "$domain" /etc/mail/domains 2> /dev/null)" ]; then echo "Error: Invalid domain" echo "Info: It should be one of the following:" cat /etc/mail/domains return 1 fi -if [ -z $(grep "$user@$domain" /etc/mail/credentials 2> /dev/null) ]; then +if [ -z "$(grep "$user@$domain" /etc/mail/credentials 2> /dev/null)" ]; then echo "Error: User doesn't exist in /etc/mail/credentials" return 1 fi -if [ -z $(grep "$user@$domain" /etc/mail/virtuals 2> /dev/null) ]; then +if [ -z "$(grep "$user@$domain" /etc/mail/virtuals 2> /dev/null)" ]; then echo "Error: User doesn't exist in /etc/mail/virtuals" return 1 fi diff --git a/files/mpasswd b/files/mpasswd @@ -9,19 +9,19 @@ fi domain=$1 user=$2 -if [ -z $(grep "$domain" /etc/mail/domains 2> /dev/null) ]; then +if [ -z "$(grep "$domain" /etc/mail/domains 2> /dev/null)" ]; then echo "Error: Invalid domain" echo "Info: It should be one of the following:" cat /etc/mail/domains return 1 fi -if [ -z $(grep "$user@$domain" /etc/mail/credentials 2> /dev/null) ]; then +if [ -z "$(grep "$user@$domain" /etc/mail/credentials 2> /dev/null)" ]; then echo "Error: User doesn't exist in /etc/mail/credentials" return 1 fi -if [ -z $(grep "$user@$domain" /etc/mail/virtuals 2> /dev/null) ]; then +if [ -z "$(grep "$user@$domain" /etc/mail/virtuals 2> /dev/null)" ]; then echo "Error: User doesn't exist in /etc/mail/virtuals" return 1 fi