docker-mailserver/target/bin/delmailuser

22 lines
379 B
Plaintext
Raw Normal View History

2016-06-14 11:16:11 +00:00
#!/bin/bash
DATABASE=/tmp/docker-mailserver/postfix-accounts.cf
function usage {
echo "Usage: delmailuser <user@domain.tld>"
exit 1
2016-06-14 11:16:11 +00:00
}
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
2016-06-14 11:16:11 +00:00
else
usage
2016-06-14 11:16:11 +00:00
fi