1
1
Fork 0
mirror of https://github.com/docker-mailserver/docker-mailserver synced 2024-05-27 23:56:07 +02:00
docker-mailserver/target/bin/delmailuser
Josef Friedrich 76d2c779df Adjust coding style in "bin" scripts (#279)
The main shell script (start-mailserver.sh) uses two spaces for
indentation. All other shell scripts should use this coding
style.
2016-08-28 21:08:37 +02:00

22 lines
379 B
Bash
Executable File

#!/bin/bash
DATABASE=/tmp/docker-mailserver/postfix-accounts.cf
function usage {
echo "Usage: delmailuser <user@domain.tld>"
exit 1
}
if [ ! -z "$1" ]; then
USER=$1
ENTRIES=$(grep "$USER" -vi $DATABASE)
echo "$ENTRIES" > $DATABASE
USER=$1
if [ -f "$DATABASE" ]; then
ENTRIES=$(grep "$USER" -vi $DATABASE)
echo "$ENTRIES" > $DATABASE
fi
else
usage
fi