mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-28 12:36:27 +02:00
remove old hashed password from RTL on change
This commit is contained in:
@@ -206,8 +206,12 @@ elif [ "${abcd}" = "b" ]; then
|
|||||||
sed -i "s/^${network}d.rpcpass=.*/${network}d.rpcpass=${newPassword}/g" /home/admin/.lnd/lnd.conf 2>/dev/null
|
sed -i "s/^${network}d.rpcpass=.*/${network}d.rpcpass=${newPassword}/g" /home/admin/.lnd/lnd.conf 2>/dev/null
|
||||||
|
|
||||||
# RTL - keep settings from current RTL-Config.json
|
# RTL - keep settings from current RTL-Config.json
|
||||||
if [ "${rtlWebinterface}" = "on" ]; then
|
if [ "${rtlWebinterface}" == "on" ]; then
|
||||||
|
echo "# changing RTL password"
|
||||||
cp /home/admin/RTL/RTL-Config.json /home/admin/RTL/backup-RTL-Config.json
|
cp /home/admin/RTL/RTL-Config.json /home/admin/RTL/backup-RTL-Config.json
|
||||||
|
# remove hashed old password
|
||||||
|
sed -i "/\b\(multiPassHashed\)\b/d" ./RTL-Config.json
|
||||||
|
# set new password
|
||||||
chmod 600 /home/admin/RTL/RTL-Config.json || exit 1
|
chmod 600 /home/admin/RTL/RTL-Config.json || exit 1
|
||||||
node > /home/admin/RTL/RTL-Config.json <<EOF
|
node > /home/admin/RTL/RTL-Config.json <<EOF
|
||||||
//Read data
|
//Read data
|
||||||
@@ -221,20 +225,23 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# electrs
|
# electrs
|
||||||
if [ "${ElectRS}" = "on" ]; then
|
if [ "${ElectRS}" == "on" ]; then
|
||||||
|
echo "# changing ELECTRS password"
|
||||||
RPC_USER=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-)
|
RPC_USER=$(cat /mnt/hdd/bitcoin/bitcoin.conf | grep rpcuser | cut -c 9-)
|
||||||
sed -i "s/^cookie = \"$RPC_USER.*\"/cookie = \"$RPC_USER:${newPassword}\"/g" /home/electrs/.electrs/config.toml 2>/dev/null
|
sed -i "s/^cookie = \"$RPC_USER.*\"/cookie = \"$RPC_USER:${newPassword}\"/g" /home/electrs/.electrs/config.toml 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# BTC-RPC-Explorer
|
# BTC-RPC-Explorer
|
||||||
if [ "${BTCRPCexplorer}" = "on" ]; then
|
if [ "${BTCRPCexplorer}" = "on" ]; then
|
||||||
|
echo "# changing BTCRPCEXPLORER password"
|
||||||
sed -i "s/^BTCEXP_BITCOIND_URI=$network:\/\/$RPC_USER:.*@127.0.0.1:8332?timeout=10000/BTCEXP_BITCOIND_URI=$network:\/\/$RPC_USER:${newPassword}@127.0.0.1:8332\?timeout=10000/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null
|
sed -i "s/^BTCEXP_BITCOIND_URI=$network:\/\/$RPC_USER:.*@127.0.0.1:8332?timeout=10000/BTCEXP_BITCOIND_URI=$network:\/\/$RPC_USER:${newPassword}@127.0.0.1:8332\?timeout=10000/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null
|
||||||
sed -i "s/^BTCEXP_BITCOIND_PASS=.*/BTCEXP_BITCOIND_PASS=${newPassword}/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null
|
sed -i "s/^BTCEXP_BITCOIND_PASS=.*/BTCEXP_BITCOIND_PASS=${newPassword}/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null
|
||||||
sed -i "s/^BTCEXP_BASIC_AUTH_PASSWORD=.*/BTCEXP_BASIC_AUTH_PASSWORD=${newPassword}/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null
|
sed -i "s/^BTCEXP_BASIC_AUTH_PASSWORD=.*/BTCEXP_BASIC_AUTH_PASSWORD=${newPassword}/g" /home/bitcoin/.config/btc-rpc-explorer.env 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# BTCPayServer
|
# BTCPayServer
|
||||||
if [ "${BTCPayServer}" = "on" ]; then
|
if [ "${BTCPayServer}" == "on" ]; then
|
||||||
|
echo "# changing BTCPAYSERVER password"
|
||||||
sed -i "s/^btc.rpc.password=.*/btc.rpc.password=${newPassword}/g" /home/btcpay/.nbxplorer/Main/settings.config 2>/dev/null
|
sed -i "s/^btc.rpc.password=.*/btc.rpc.password=${newPassword}/g" /home/btcpay/.nbxplorer/Main/settings.config 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# requests missing in dietpi
|
# requests missing in dietpi
|
||||||
sudo pip install requests
|
sudo pip install requests 2>/dev/null
|
||||||
|
|
||||||
# command info
|
# command info
|
||||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||||
|
Reference in New Issue
Block a user