change to none

This commit is contained in:
rootzoll
2021-07-24 01:13:19 +02:00
parent 36624395d8
commit 7ce01df694
4 changed files with 120 additions and 88 deletions

View File

@@ -47,6 +47,12 @@ if [ ${#hostname} -eq 0 ]; then
exit 1
fi
# check if config files contain lightning (lnd is default)
if [ "${lightning}" == "" ]; then
lightning="lnd"
echo "lightning=${lightning}" >> ${configFile}
fi
# load codeVersion
source /home/admin/_version.info
@@ -130,6 +136,37 @@ else
echo "WARN: /mnt/hdd/bitcoin/bitcoin.conf not found" >> ${logFile}
fi
echo "Version Code: ${codeVersion}" >> ${logFile}
echo "Version Data: ${raspiBlitzVersion}" >> ${logFile}
if [ "${raspiBlitzVersion}" != "${codeVersion}" ]; then
echo "detected version change ... starting migration script" >> ${logFile}
# nothing specific here yet
echo "OK Done - Updating version in config"
sudo sed -i "s/^raspiBlitzVersion=.*/raspiBlitzVersion='${codeVersion}'/g" ${configFile}
else
echo "OK - version of config data is up to date" >> ${logFile}
fi
# start network service
echo ""
echo "*** Start ${network} ***" >> ${logFile}
sudo sed -i "s/^message=.*/message='Blockchain Testrun'/g" ${infoFile}
echo "- This can take a while .." >> ${logFile}
sudo cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.service
#sudo chmod +x /etc/systemd/system/${network}d.service
sudo systemctl daemon-reload >> ${logFile}
sudo systemctl enable ${network}d.service >> ${logFile}
sudo systemctl start ${network}d.service >> ${logFile}
# INSTALL LND on Upadte/Recovery
if [ "${lightning}" == "lnd" ]; then
# prepare lnd service
sed -i "5s/.*/Wants=${network}d.service/" /home/admin/assets/lnd.service >> ${logFile} 2>&1
sed -i "6s/.*/After=${network}d.service/" /home/admin/assets/lnd.service >> ${logFile} 2>&1
sudo cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service >> ${logFile} 2>&1
# if old lnd.conf exists ...
configExists=$(sudo ls /mnt/hdd/lnd/lnd.conf | grep -c '.conf')
if [ ${configExists} -eq 1 ]; then
@@ -203,39 +240,37 @@ if [ ${configExists} -eq 1 ]; then
else
echo " - WARN: section '[Application Options]' not found in lnd.conf" >> ${logFile}
fi
else
echo "WARN: /mnt/hdd/lnd/lnd.conf not found" >> ${logFile}
fi
echo "Version Code: ${codeVersion}" >> ${logFile}
echo "Version Data: ${raspiBlitzVersion}" >> ${logFile}
if [ "${raspiBlitzVersion}" != "${codeVersion}" ]; then
echo "detected version change ... starting migration script" >> ${logFile}
# nothing specific here yet
echo "OK Done - Updating version in config"
sudo sed -i "s/^raspiBlitzVersion=.*/raspiBlitzVersion='${codeVersion}'/g" ${configFile}
else
echo "OK - version of config data is up to date" >> ${logFile}
fi
# start network service
echo ""
echo "*** Start ${network} ***" >> ${logFile}
sudo sed -i "s/^message=.*/message='Blockchain Testrun'/g" ${infoFile}
echo "- This can take a while .." >> ${logFile}
sudo cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.service
#sudo chmod +x /etc/systemd/system/${network}d.service
sudo systemctl daemon-reload >> ${logFile}
sudo systemctl enable ${network}d.service >> ${logFile}
sudo systemctl start ${network}d.service >> ${logFile}
# start lightning service
# start LND service
echo "Starting LND Service ..." >> ${logFile}
sudo systemctl enable lnd >> ${logFile}
sudo systemctl start lnd >> ${logFile}
elif [ "${lightning}" == "cln" ]; then
echo "Install C-lightning on update" >> ${logFile}
sudo sed -i "s/^message=.*/message='C-Lightning Install'/g" ${infoFile}
sudo /home/admin/config.scripts/cln.install.sh on mainnet >> ${logFile}
sudo sed -i "s/^message=.*/message='C-Lightning Setup'/g" ${infoFile}
elif [ "${lightning}" == "none" ]; then
echo "No Lightnig" >> ${logFile}
else
sed -i "s/^state=.*/state=error/g" ${infoFile}
sed -i "s/^message=.*/message='unknown lightning (${lightning})'/g" ${infoFile}
echo "FAIL see ${logFile}"
echo "FAIL: unknown lightning (${lightning}) in (${configFile})!" >> ${logFile}
exit 1
fi
echo "END Migration/Init" >> ${logFile}
exit 0

View File

@@ -149,14 +149,11 @@ sudo cp -r /mnt/hdd/lnd/data/chain /home/admin/.lnd/data/chain >> ${logFile} 2>&
sudo chown -R admin:admin /home/admin/.${network} >> ${logFile} 2>&1
sudo chown -R admin:admin /home/admin/.lnd >> ${logFile} 2>&1
sudo cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.service >> ${logFile} 2>&1
sed -i "5s/.*/Wants=${network}d.service/" /home/admin/assets/lnd.service >> ${logFile} 2>&1
sed -i "6s/.*/After=${network}d.service/" /home/admin/assets/lnd.service >> ${logFile} 2>&1
sudo cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service >> ${logFile} 2>&1
sudo cp /home/admin/assets/tmux.conf.local /mnt/hdd/.tmux.conf.local >> ${logFile} 2>&1
sudo chown admin:admin /mnt/hdd/.tmux.conf.local >> ${logFile} 2>&1
sudo ln -s -f /mnt/hdd/.tmux.conf.local /home/admin/.tmux.conf.local >> ${logFile} 2>&1
# backup LND dir (especially for macaroons and tlscerts)
# https://github.com/rootzoll/raspiblitz/issues/324
echo "*** Make backup of LND directory" >> ${logFile}

View File

@@ -234,7 +234,7 @@ if [ "${setupPhase}" == "setup" ]; then
lightningWalletDone=0
source ${SETUPFILE}
if [ "${lightning}" == "" ]; then lightningWalletDone=1; fi
if [ "${lightning}" == "none" ]; then lightningWalletDone=1; fi
while [ "${lightningWalletDone}" == "0" ]
do

View File

@@ -73,7 +73,7 @@ if [ "${network}" == "bitcoin" ]; then
lightning="cln"
;;
NONE)
lightning=""
lightning="none"
;;
*)
clear