浏览代码

Merge pull request #5029 from scruel/patch-2

Prevent leaving blank lines in config file after cleared keys.
neil 1 年之前
父节点
当前提交
8635d89cc8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      acme.sh

+ 1 - 1
acme.sh

@@ -2361,7 +2361,7 @@ _clear_conf() {
   _sdkey="$2"
   if [ "$_c_c_f" ]; then
     _conf_data="$(cat "$_c_c_f")"
-    echo "$_conf_data" | sed "s/^$_sdkey *=.*$//" >"$_c_c_f"
+    echo "$_conf_data" | sed "/^$_sdkey *=.*$/d" >"$_c_c_f"
   else
     _err "Config file is empty, cannot clear"
   fi