From 7286d72ed735f8d7378405e30c56ae39adf127c8 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Wed, 20 Apr 2022 23:05:25 -0500 Subject: [PATCH] Add pre-btcpayserver script --- .../standard/etc/systemd/system/btcpayserver.service | 1 + .../usr/bin/service_scripts/pre_btcpayserver.sh | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100755 rootfs/standard/usr/bin/service_scripts/pre_btcpayserver.sh diff --git a/rootfs/standard/etc/systemd/system/btcpayserver.service b/rootfs/standard/etc/systemd/system/btcpayserver.service index 857d9d7a..af746aef 100644 --- a/rootfs/standard/etc/systemd/system/btcpayserver.service +++ b/rootfs/standard/etc/systemd/system/btcpayserver.service @@ -14,6 +14,7 @@ RemainAfterExit=yes ExecStartPre=/usr/bin/is_not_shutting_down.sh ExecStartPre=/usr/bin/is_mainnet.sh ExecStartPre=/usr/bin/wait_on_docker_image_install.sh +ExecStartPre=+/usr/bin/service_scripts/pre_btcpayserver.sh ExecStart=/bin/bash -c '. "/etc/profile.d/btcpay-env.sh" && cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker" && . helpers.sh && btcpay_up' ExecStop=/bin/bash -c '. "/etc/profile.d/btcpay-env.sh" && cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker" && . helpers.sh && btcpay_down' diff --git a/rootfs/standard/usr/bin/service_scripts/pre_btcpayserver.sh b/rootfs/standard/usr/bin/service_scripts/pre_btcpayserver.sh new file mode 100755 index 00000000..c9f849ff --- /dev/null +++ b/rootfs/standard/usr/bin/service_scripts/pre_btcpayserver.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +source /usr/share/mynode/mynode_config.sh + +set -x + +# Update Bitcoin RPC Password +BTCRPCPW=$(cat /mnt/hdd/mynode/settings/.btcrpcpw) +if [ -f /mnt/hdd/mynode/btcpayserver/.env ]; then + sed -i "s/REMOTE_BTC_RPC_PASSWORD=.*/REMOTE_BTC_RPC_PASSWORD=$BTCRPCPW/g" /mnt/hdd/mynode/btcpayserver/.env +fi