stop services on inconsistent state

This commit is contained in:
rootzoll
2021-06-21 17:09:03 +02:00
parent 88573fab3f
commit 98546684fb
2 changed files with 3 additions and 1 deletions

View File

@@ -97,6 +97,8 @@ sudo chmod 777 ${infoFile}
# when the provision did not ran thru without error (ask user for fresh sd card)
provisionFlagExists=$(sudo ls /home/admin/provision.flag | grep -c 'provision.flag')
if [ "${provisionFlagExists}" == "1" ]; then
sudo systemctl stop ${network}d 2>/dev/null
sudo systemctl stop lnd 2>/dev/null
sed -i "s/^state=.*/state=inconsistentsystem/g" ${infoFile}
sed -i "s/^message=.*/message='provision did not ran thru'/g" ${infoFile}
echo "FAIL: 'provision did not ran thru - need fresh sd card!" >> ${logFile}

View File

@@ -380,7 +380,7 @@ if [ "$1" = "source" ]; then
done
# transfere end flag
sed -i "s/^state=.*/state=/g" /home/admin/raspiblitz.info
sed -i "s/^state=.*/state=ready/g" /home/admin/raspiblitz.info
date +%s > /home/admin/copy_end.time
sudo sshpass -p "${targetPassword}" rsync -avhW -e 'ssh -o StrictHostKeyChecking=no -p 22' /home/admin/copy_end.time bitcoin@${targetIP}:/mnt/hdd/bitcoin
sudo rm -f /home/admin/copy_end.time