From 4fedf42da925be8c919669b51306b72f7f69dada Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 12 Jun 2019 22:30:46 +0900 Subject: [PATCH] Use while look instead of xargs --- btcpay-setup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/btcpay-setup.sh b/btcpay-setup.sh index 1b44966..9116650 100755 --- a/btcpay-setup.sh +++ b/btcpay-setup.sh @@ -206,7 +206,8 @@ fi # Put the variables in /etc/profile.d when a user log interactively touch "/etc/profile.d/btcpay-env.sh" -echo " +echo "#!/bin/bash + export COMPOSE_HTTP_TIMEOUT=\"180\" export BTCPAYGEN_OLD_PREGEN=\"$BTCPAYGEN_OLD_PREGEN\" export BTCPAYGEN_CRYPTO1=\"$BTCPAYGEN_CRYPTO1\" @@ -227,7 +228,9 @@ export BTCPAY_BASE_DIRECTORY=\"$BTCPAY_BASE_DIRECTORY\" export BTCPAY_ENV_FILE=\"$BTCPAY_ENV_FILE\" export BTCPAY_HOST_SSHKEYFILE=\"$BTCPAY_HOST_SSHKEYFILE\" if cat \"\$BTCPAY_ENV_FILE\" &> /dev/null; then - export \$(grep -v '^#' \"\$BTCPAY_ENV_FILE\" | xargs) + while IFS= read -r line; do + export \"\$line\" + done < \"\$BTCPAY_ENV_FILE\" fi " > /etc/profile.d/btcpay-env.sh chmod +x /etc/profile.d/btcpay-env.sh