mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 09:34:33 +02:00
start-mailserver.sh split (#1820)
* splitting start-mailserver.sh * refactoring part 2 * refactored setup-stack.sh * stzarted adjusting target/bin/*.sh to use new usage format * corrected lowercase-uppercase test error * better handling of .bashrc variable export * linting tests and fix for default assignements * last stylistic changes and rebase
This commit is contained in:
parent
2262d354db
commit
c881facbd2
21 changed files with 2214 additions and 2278 deletions
|
@ -8,12 +8,16 @@ DATABASE=${DATABASE:-/tmp/docker-mailserver/postfix-virtual.cf}
|
|||
EMAIL="${1}"
|
||||
RECIPIENT="${2}"
|
||||
|
||||
function usage { echo "Usage: delalias <alias@domain> <recipient@other>" ; }
|
||||
function __usage { echo "Usage: delalias <alias@domain> <recipient@other>" ; }
|
||||
|
||||
[[ -z ${EMAIL} ]] && { usage ; errex "Error: No alias specified" ; }
|
||||
[[ -z ${RECIPIENT} ]] && { usage ; errex "Error: No recipient specified" ; }
|
||||
[[ ${1:-} == 'help' ]] && { __usage ; exit 0 ; }
|
||||
|
||||
[[ -z ${EMAIL} ]] && { __usage ; errex "Error: No alias specified" ; }
|
||||
[[ -z ${RECIPIENT} ]] && { __usage ; errex "Error: No recipient specified" ; }
|
||||
[[ -s ${DATABASE} ]] || exit 0
|
||||
|
||||
sed -i -e "/^${EMAIL} *${RECIPIENT}$/d" \
|
||||
sed -i \
|
||||
-e "/^${EMAIL} *${RECIPIENT}$/d" \
|
||||
-e "/^${EMAIL}/s/,${RECIPIENT}//g" \
|
||||
-e "/^${EMAIL}/s/${RECIPIENT},//g" "${DATABASE}"
|
||||
-e "/^${EMAIL}/s/${RECIPIENT},//g" \
|
||||
"${DATABASE}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue