From 6c5ce5ab4ad8bea344b46cd3815dc412b4c75d14 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 6 Oct 2022 10:46:07 +0900 Subject: [PATCH] Make sshd config change handle tab as well --- helpers.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.sh b/helpers.sh index 783ba21..f73eaea 100755 --- a/helpers.sh +++ b/helpers.sh @@ -84,10 +84,10 @@ fi sshd_config="/etc/ssh/sshd_config" if [[ "$BTCPAY_ENABLE_SSH" == "true" ]] && \ [[ -f "$sshd_config" ]] && \ - grep -Fxq "PermitRootLogin no" "$sshd_config"; then + grep -q "PermitRootLogin[[:space:]]no" "$sshd_config"; then echo "Updating "$sshd_config" (Change from 'PermitRootLogin no' to 'PermitRootLogin prohibit-password')" echo "BTCPay Server needs connection from inside the container to the host in order to run btcpay-update.sh" - sed -i 's/PermitRootLogin no/PermitRootLogin prohibit-password/' "$sshd_config" + sed -i 's/PermitRootLogin[[:space:]]no/PermitRootLogin prohibit-password/' "$sshd_config" service sshd reload fi