Skip to content

Commit

Permalink
Fix docker-entrypoint for raspberry
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Sep 24, 2019
1 parent e8d5190 commit 7a5cfcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Expand Up @@ -2,7 +2,7 @@

echo "$(/sbin/ip route|awk '/default/ { print $3 }') host.docker.internal" >> /etc/hosts

if [[ "$BTCPAY_SSHKEYFILE" ]] && ! [ -f "$BTCPAY_SSHKEYFILE" ]; then
if [ ! -z "$BTCPAY_SSHKEYFILE" ] && ! [ -f "$BTCPAY_SSHKEYFILE" ]; then
echo "Creating BTCPay Server SSH key File..."
ssh-keygen -t rsa -f "$BTCPAY_SSHKEYFILE" -q -P "" -m PEM -C btcpayserver > /dev/null
if [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ]; then
Expand All @@ -13,7 +13,7 @@ if [[ "$BTCPAY_SSHKEYFILE" ]] && ! [ -f "$BTCPAY_SSHKEYFILE" ]; then
fi
fi

if [[ "$BTCPAY_SSHKEYFILE" ]] && [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ] && ! grep -q "btcpayserver$" "$BTCPAY_SSHAUTHORIZEDKEYS"; then
if [ ! -z "$BTCPAY_SSHKEYFILE" ] && [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ] && ! grep -q "btcpayserver$" "$BTCPAY_SSHAUTHORIZEDKEYS"; then
echo "Adding BTCPay Server SSH key to authorized keys"
cat "$BTCPAY_SSHKEYFILE.pub" >> "$BTCPAY_SSHAUTHORIZEDKEYS"
fi
Expand Down

0 comments on commit 7a5cfcf

Please sign in to comment.