From 23cb43c85fc0402a1e0ccbb1514b54dd95c218da Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 7 Jan 2016 22:49:43 +0800 Subject: [PATCH] fix issue: sed contains "&" sign --- le.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/le.sh b/le.sh index bedd7f32..95c48ebf 100755 --- a/le.sh +++ b/le.sh @@ -196,6 +196,9 @@ _setopt() { fi if grep -H -n "^$__opt$__sep" "$__conf" > /dev/null ; then _debug OK + if [[ "$__val" == *"&"* ]] ; then + __val="$(echo $__val | sed 's/&/\\&/g')" + fi sed -i "s|^$__opt$__sep.*$|$__opt$__sep$__val$__end|" "$__conf" else _debug APP