fix section insert

This commit is contained in:
rootzoll 2021-08-27 15:11:50 +02:00
parent a26e9d48c3
commit 1ababb979c

View File

@ -73,7 +73,8 @@ if [ "$1" == "prestart" ]; then
if [ "${sectionExists}" == "0" ]; then
echo "# adding section [${network}d]"
echo "
[${network}d]" | sudo tee -a ${lndConfFile}
[${network}d]
" | sudo tee -a ${lndConfFile}
fi
# get line number of [bitcoind] section
@ -90,6 +91,7 @@ if [ "$1" == "prestart" ]; then
if [ "${settingExists}" == "0" ]; then
echo "# adding setting (${setting})"
sudo sed -i "${insertLine}i${network}d\.${setting}=" ${lndConfFile}
sudo sed -i "32ibitcoind\.zmqpubrawtx=" /mnt/hdd/lnd/lnd.conf
fi
echo "# updating setting (${setting}) with value(${value})"
sudo sed -i "s/^${network}d\.${setting}=.*/${network}d\.${setting}=${value}/g" ${lndConfFile}