satisfy shellcheck a bit more
authorIan Kelling <ian@iankelling.org>
Thu, 16 Dec 2021 01:20:17 +0000 (20:20 -0500)
committerIan Kelling <ian@iankelling.org>
Thu, 16 Dec 2021 01:20:17 +0000 (20:20 -0500)
mail-setup

index 7012669eededfc9a7eb5d4976838e1aec6f35084..526c51e64bdeee40d1f00532fef7e6108e245c00 100755 (executable)
@@ -290,7 +290,7 @@ i() { # install file
 setini() {
   key="$1" value="$2" section="$3"
   file="/etc/radicale/config"
-  sed -ri "/ *\[$section\]/,/^ *\[[^]]+\]/{/^\s*$key[[:space:]=]/d};/ *\[$section\]/a $key = $value" "$file"
+  sed -ri "/ *\[$section\]/,/^ *\[[^]]+\]/{/^\s*${key}[[:space:]=]/d};/ *\[$section\]/a $key = $value" "$file"
 }
 soff () {
   for service; do
@@ -1321,7 +1321,7 @@ xioE3sYKdjOt+p6mlg3l8+OLtODEFPHDqwIBAg==
 -----END DH PARAMETERS-----
 EOF
     {
-      if [[ $HOSTNAME == $MAIL_HOST ]]; then
+      if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
         cat <<'EOF'
 ssl_cert = </etc/exim4/fullchain.pem
 ssl_key = </etc/exim4/privkey.pem