docker-mailserver/target/bin/delmailuser

17 lines
254 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 {
2016-06-14 11:28:15 +00:00
echo "Usage: delmailuser <user@domain.tld>"
2016-06-14 11:16:11 +00:00
exit 1
}
if [ ! -z "$1" ]; then
2016-06-14 11:29:55 +00:00
USER=$1
2016-06-14 11:16:11 +00:00
ENTRIES=$(grep "$USER" -vi $DATABASE)
2016-06-14 11:28:15 +00:00
echo "$ENTRIES" > $DATABASE
2016-06-14 11:16:11 +00:00
else
usage
fi