RTL default config

This commit is contained in:
rootzoll
2021-08-04 09:25:13 +02:00
parent f089a63811
commit 967bf4fa46

View File

@@ -29,7 +29,7 @@ if [ ${#network} -eq 0 ]; then
fi fi
# LNTYPE is lnd | cln # LNTYPE is lnd | cln
if [ $# -gt 1 ];then if [ $# -gt 1 ]; then
LNTYPE=$2 LNTYPE=$2
else else
LNTYPE=lnd LNTYPE=lnd
@@ -40,7 +40,7 @@ if [ ${LNTYPE} != lnd ]&&[ ${LNTYPE} != cln ];then
fi fi
# CHAIN is signet | testnet | mainnet # CHAIN is signet | testnet | mainnet
if [ $# -gt 2 ];then if [ $# -gt 2 ]; then
CHAIN=$3 CHAIN=$3
else else
CHAIN=${chain}net CHAIN=${chain}net
@@ -50,22 +50,23 @@ if [ ${CHAIN} != testnet ]&&[ ${CHAIN} != mainnet ]&&[ ${CHAIN} != signet ];then
exit 1 exit 1
fi fi
# prefix for parallel services # prefix for parallel networks
if [ ${CHAIN} = testnet ];then if [ "${CHAIN}" == "testnet" ]; then
netprefix="t" netprefix="t"
portprefix=1 portprefix=1
elif [ ${CHAIN} = signet ];then elif [ "${CHAIN}" == "signet" ]; then
netprefix="s" netprefix="s"
portprefix=3 portprefix=3
elif [ ${CHAIN} = mainnet ];then elif [ "${CHAIN}" == "mainnet" ]; then
netprefix="" netprefix=""
portprefix="" portprefix=""
fi fi
if [ ${LNTYPE} = cln ]; then # prefix for parallel lightning impl
if [ "${LNTYPE}" == "cln" ]; then
RTLHTTP=${portprefix}7000 RTLHTTP=${portprefix}7000
typeprefix=c typeprefix="c"
elif [ ${LNTYPE} = lnd ];then elif [ "${LNTYPE}" == "lnd" ]; then
RTLHTTP=${portprefix}3000 RTLHTTP=${portprefix}3000
typeprefix="" typeprefix=""
fi fi
@@ -104,8 +105,12 @@ Activate TOR to access the web interface from outside your local network.
fi fi
# add default value to raspi config if needed # add default value to raspi config if needed
if ! grep -Eq "^${netprefix}${typeprefix}rtlWebinterface=" /mnt/hdd/raspiblitz.conf; then configEntryExists=$(sudo cat /mnt/hdd/raspiblitz.conf | grep -c "${netprefix}${typeprefix}rtlWebinterface=")
if [ "${configEntryExists}" == "0" ]; then
echo "# adding default config entry for '${netprefix}${typeprefix}rtlWebinterface'"
echo "${netprefix}${typeprefix}rtlWebinterface=off" >> /mnt/hdd/raspiblitz.conf echo "${netprefix}${typeprefix}rtlWebinterface=off" >> /mnt/hdd/raspiblitz.conf
else
echo "# default config entry for '${netprefix}${typeprefix}rtlWebinterface' exists"
fi fi
# stop services # stop services