fix sed expression

This commit is contained in:
rootzoll 2021-08-27 15:00:30 +02:00
parent 6111ea3d6e
commit fc399cff81
3 changed files with 4 additions and 15 deletions

View file

@ -171,16 +171,6 @@ if [ "${lightning}" == "lnd" ]; then
configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf')
if [ ${configExists} -eq 1 ]; then
# remove RPC user & pass from lnd.conf ... since v1.7
# https://github.com/rootzoll/raspiblitz/issues/2160
echo "- #2160 lnd.conf --> make sure contains no RPC user/pass for bitcoind" >> ${logFile}
sudo sed -i '/^\[Bitcoind\]/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.rpchost=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.rpcpass=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.rpcuser=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.zmqpubrawblock=/d' /mnt/hdd/lnd/lnd.conf
sudo sed -i '/^bitcoind.zmqpubrawtx=/d' /mnt/hdd/lnd/lnd.conf
# make sure additional values are added to [Application Options] since v1.7
echo "- lnd.conf --> checking additional [Application Options] since v1.7" >> ${logFile}
applicationOptionsLineNumber=$(sudo grep -n "\[Application Options\]" /mnt/hdd/lnd/lnd.conf | cut -d ":" -f1)

View file

@ -56,15 +56,14 @@ source /home/admin/raspiblitz.info
if ! grep -Eq "^${netprefix}lnd=" /mnt/hdd/raspiblitz.conf; then
echo "${netprefix}lnd=off" >> /mnt/hdd/raspiblitz.conf
fi
source /mnt/hdd/raspiblitz.conf
source /mnt/hdd/raspiblitz.conf
source /mnt/hdd/raspiblitz.conf
# switch on
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
RPCUSER=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcuser | cut -c 9-)
RPCPSW=$(sudo cat /mnt/hdd/${network}/${network}.conf | grep rpcpassword | cut -c 13-)
RPCPSW=$(sudo cat /mnt/hdd/${nesudo twork}/${network}.conf | grep rpcpassword | cut -c 13-)
echo "# Check mainnet lnd.conf"
# it does not pick up main.zmqpubraw entries from bitcoin.conf, need to set manually

View file

@ -83,7 +83,7 @@ if [ "$1" == "prestart" ]; then
# CHECK zmqpubrawtx
setting="zmqpubrawtx"
value="tcp://127.0.0.1:${zmqprefix}333"
value="tcp\:\/\/127\.0\.0\.1\:${zmqprefix}333"
settingExists=$(sudo cat ${lndConfFile} | grep -c "^${network}d.${setting}=")
echo "# ${network}d.${setting} exists->(${settingExists})"
if [ "${settingExists}" == "0" ]; then
@ -91,7 +91,7 @@ if [ "$1" == "prestart" ]; then
sudo sed -i "${insertLine}i${network}d.zmqpubrawtx=" ${lndConfFile}
fi
echo "# updating setting (${setting}) with value(${value})"
sudo sed -i "s/^${network}d.${setting}=.*/${network}d.${setting}='${value}'/g" ${lndConfFile}
sudo sed -i "s/^${network}d\.zmqpubrawtx=.*/${network}d\.zmqpubrawtx=\'${value}\'/g" ${lndConfFile}
# remove RPC user & pass from lnd.conf ... since v1.7
# https://github.com/rootzoll/raspiblitz/issues/2160