1
0
mirror of https://github.com/tomav/docker-mailserver.git synced 2024-06-25 00:38:11 +02:00

Check if second argument is given

This commit is contained in:
Casper 2020-07-19 21:21:01 +02:00 committed by GitHub
parent f206ad7ee1
commit 7c0998f7fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,8 @@ escape() {
echo "${1//./\\.}"
}
[ -z "$EMAIL" ] && { usage; errex "no email specified"; }
[ -z "$EMAIL" ] && { usage; errex "Error: No alias specified"; }
[ -z "$RECIPIENT" ] && { usage; errex "Error: No recipient specified"; }
grep -qi "^$(escape $EMAIL)[a-zA-Z@.\ ]*$(escape $RECIPIENT)" $DATABASE 2>/dev/null &&
errex "Alias \"$EMAIL $RECIPIENT\" already exists"