From e0f6435d86502bc5cb73d68342a1f46c754ba154 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Wed, 8 Jun 2016 11:29:12 +0200 Subject: [PATCH] Fix removal of domains with schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In at least one case a customer of ours added a domain including a schema, as in “http://domain.tld/”. That is obviously incorrect, but then they couldn't remove it using the dokku command: $ dokku domains:remove app7 http://domain.tld/ sed: -e expression #1, char 9: unknown command: `/' This patch changes the sed command to use the "\CregexpC" syntax. The character used is a vertical pipe, which is far less likely to be used in a URL. After the change: $ dokku domains:remove app7 http://domain.tld/ -----> Removed http://domain.tld/ from app7 Signed-off-by: Michael Hanselmann --- plugins/domains/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/domains/functions b/plugins/domains/functions index 821d04b71..f563b8e50 100755 --- a/plugins/domains/functions +++ b/plugins/domains/functions @@ -92,7 +92,7 @@ domains_remove() { shift 1 for DOMAIN in "$@"; do - sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST" + sed -i "\|^$DOMAIN\$|d" "$DOKKU_ROOT/$APP/VHOST" dokku_log_info1 "Removed $DOMAIN from $APP" done plugn trigger post-domains-update "$APP" "remove" "$@"