Make sshd config change handle tab as well

This commit is contained in:
nicolas.dorier 2022-10-06 10:46:07 +09:00
parent b00c0a9800
commit 6c5ce5ab4a
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -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