mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-21 14:11:06 +02:00
stop services on inconsistent state
This commit is contained in:
@@ -97,6 +97,8 @@ sudo chmod 777 ${infoFile}
|
|||||||
# when the provision did not ran thru without error (ask user for fresh sd card)
|
# 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')
|
provisionFlagExists=$(sudo ls /home/admin/provision.flag | grep -c 'provision.flag')
|
||||||
if [ "${provisionFlagExists}" == "1" ]; then
|
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/^state=.*/state=inconsistentsystem/g" ${infoFile}
|
||||||
sed -i "s/^message=.*/message='provision did not ran thru'/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}
|
echo "FAIL: 'provision did not ran thru - need fresh sd card!" >> ${logFile}
|
||||||
|
@@ -380,7 +380,7 @@ if [ "$1" = "source" ]; then
|
|||||||
done
|
done
|
||||||
|
|
||||||
# transfere end flag
|
# 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
|
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 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
|
sudo rm -f /home/admin/copy_end.time
|
||||||
|
Reference in New Issue
Block a user