electrs: use rm -f and fail if chnmod 600 fails

This commit is contained in:
openoms
2019-09-18 17:18:26 +01:00
parent 8f64861191
commit e4613e497c
2 changed files with 6 additions and 7 deletions

View File

@@ -21,14 +21,14 @@ To download and run:
### Setting up BTCPayServer
* Go to your domain.
* Create a Store.
* Go to your domain
* Register the first (administrator) account
* Create a Store
* In Store settings set up the derivation scheme (add an xpub)
* Set up LN with the connection string:
`type=lnd-rest;server=https://127.0.0.1:8080/;macaroonfilepath=/home/admin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon;allowinsecure=true`
* Continue with: https://docs.btcpayserver.org/btcpay-basics/gettingstarted
* Find more detailed info on https://docs.btcpayserver.org/btcpay-basics/gettingstarted
---

View File

@@ -57,12 +57,11 @@ echo ""
# generate setting file: https://github.com/romanz/electrs/issues/170#issuecomment-530080134
# https://github.com/romanz/electrs/blob/master/doc/usage.md#configuration-files-and-environment-variables
sudo rm /home/electrs/.electrs/config.toml 2>/dev/null
sudo rm -f /home/electrs/.electrs/config.toml
sudo -u electrs mkdir /home/electrs/.electrs 2>/dev/null
touch /home/admin/config.toml
chmod 600 /home/admin/config.toml
chmod 600 /home/admin/config.toml || exit 1
cat > /home/admin/config.toml <<EOF
verbose = 4
timestamp = true