mmv

mailserver bootstrap script
git clone git://git.yotsev.xyz/mmv.git
Log | Files | Refs | README | LICENSE

commit 21a4543a5f9a075dffd5d463f43e514d9ca303ea
parent 9aedc992e9dbc5cd1192fe16ae94532218aefc69
Author: Petar Yotsev <petar@yotsev.xyz>
Date:   Tue, 14 Dec 2021 12:08:50 +0000

Fix more if statements

Diffstat:
Mfiles/madduser | 6+++---
Mfiles/mdeluser | 6+++---
Mfiles/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 @@ -7,19 +7,19 @@ echo "Usage: mdeluser DOMAIN USERNAME" 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 @@ -7,19 +7,19 @@ echo "Usage: mpasswd DOMAIN USERNAME" 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