Mac os support (#156)
* Mac OS support * Mac OS support * Improved output + fixed docker command not being linked * Improved docker install * Added manual installation message if needed * Fixed issue with if … fi nesting + using double [[ ]] now as better practise * Fixed indentation + using double [[ ]] everywhere * More [[ ]] changes * Fixed issue due to bad merge * Empty if statement gives error * Cannot set logging in /etc/docker/daemon.json for Mac * Better quoting of $BASH_PROFILE_SCRIPT * Removed comment + Added “elif” * Added quotes * Added quotes * Removed TODO, BTCPay server works after reboot and all commands run fine. * Fixed broken detection if line is already in $HOME/.bash_profile
This commit is contained in:
committed by
Nicolas Dorier
parent
bf4f104f59
commit
dc5cdf27a9
@@ -2,7 +2,16 @@
|
||||
|
||||
set -e
|
||||
|
||||
. /etc/profile.d/btcpay-env.sh
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# Mac OS
|
||||
BASH_PROFILE_SCRIPT="$HOME/btcpay-env.sh"
|
||||
|
||||
else
|
||||
# Linux
|
||||
BASH_PROFILE_SCRIPT="/etc/profile.d/btcpay-env.sh"
|
||||
fi
|
||||
|
||||
. ${BASH_PROFILE_SCRIPT}
|
||||
|
||||
if [ ! -z $BTCPAY_DOCKER_COMPOSE ] && [ ! -z $DOWNLOAD_ROOT ] && [ -z $BTCPAYGEN_OLD_PREGEN ]; then
|
||||
echo "Your deployment is too old, you need to migrate by following instructions on this link https://github.com/btcpayserver/btcpayserver-docker/tree/master#i-deployed-before-btcpay-setupsh-existed-before-may-17-can-i-migrate-to-this-new-system"
|
||||
@@ -22,22 +31,29 @@ if [[ "$1" != "--skip-git-pull" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if ! [ -f "/etc/docker/daemon.json" ]; then
|
||||
echo "{
|
||||
|
||||
if ! [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# Not Mac OS
|
||||
# TODO Should we configure logging for Mac OS too? The file path will be different and access rights need to be considered too...
|
||||
|
||||
if ! [ -f "/etc/docker/daemon.json" ]; then
|
||||
echo "{
|
||||
\"log-driver\": \"json-file\",
|
||||
\"log-opts\": {\"max-size\": \"5m\", \"max-file\": \"3\"}
|
||||
}" > /etc/docker/daemon.json
|
||||
echo "Setting limited log files in /etc/docker/daemon.json"
|
||||
echo "Setting limited log files in /etc/docker/daemon.json"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
. ./build.sh
|
||||
if [ "$BTCPAYGEN_OLD_PREGEN" == "true" ]; then
|
||||
cp Generated/docker-compose.generated.yml $BTCPAY_DOCKER_COMPOSE
|
||||
cp Generated/torrc.tmpl "$(dirname "$BTCPAY_DOCKER_COMPOSE")/torrc.tmpl"
|
||||
fi
|
||||
|
||||
if ! grep -Fxq "export COMPOSE_HTTP_TIMEOUT=\"180\"" "/etc/profile.d/btcpay-env.sh"; then
|
||||
echo "export COMPOSE_HTTP_TIMEOUT=\"180\"" >> /etc/profile.d/btcpay-env.sh
|
||||
if ! grep -Fxq "export COMPOSE_HTTP_TIMEOUT=\"180\"" "$BASH_PROFILE_SCRIPT"; then
|
||||
echo "export COMPOSE_HTTP_TIMEOUT=\"180\"" >> "$BASH_PROFILE_SCRIPT"
|
||||
export COMPOSE_HTTP_TIMEOUT=180
|
||||
echo "Adding COMPOSE_HTTP_TIMEOUT=180 in btcpay-env.sh"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user