From 34e2e5c4555a691a9a27ca020191de0ad7db5a85 Mon Sep 17 00:00:00 2001 From: Robert Habermann Date: Tue, 4 Jun 2019 10:09:40 +0100 Subject: [PATCH] add dedicated shutdown/reboot scripts --- home.admin/XXreboot.sh | 28 ++++++++++++++++++++++++++++ home.admin/XXshutdown.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100755 home.admin/XXreboot.sh create mode 100755 home.admin/XXshutdown.sh diff --git a/home.admin/XXreboot.sh b/home.admin/XXreboot.sh new file mode 100755 index 0000000..c1673ac --- /dev/null +++ b/home.admin/XXreboot.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# CONFIGFILE - configuration of RaspiBlitz +configFile="/mnt/hdd/raspiblitz.conf" + +# INFOFILE - state data from bootstrap +infoFile="/home/admin/raspiblitz.info" + +# MAIN MENU AFTER SETUP +source ${infoFile} +source ${configFile} + +echo "" +echo "LCD turns white when shutdown complete." +echo "Then wait 5 seconds and disconnect power." +echo "-----------------------------------------------" +echo "stop lnd - please wait .." +sudo systemctl stop lnd +echo "stop ${network}d (1) - please wait .." +sudo -u bitcoin ${network}-cli stop +sleep 10 +echo "stop ${network}d (2) - please wait .." +sudo systemctl stop ${network}d +sleep 3 +sync +echo "starting shutdown ..." +sudo shutdown -r now +exit 0 diff --git a/home.admin/XXshutdown.sh b/home.admin/XXshutdown.sh new file mode 100755 index 0000000..9902d9f --- /dev/null +++ b/home.admin/XXshutdown.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# CONFIGFILE - configuration of RaspiBlitz +configFile="/mnt/hdd/raspiblitz.conf" + +# INFOFILE - state data from bootstrap +infoFile="/home/admin/raspiblitz.info" + +# MAIN MENU AFTER SETUP +source ${infoFile} +source ${configFile} + +network=bitcoin + +echo "" +echo "LCD turns white when shutdown complete." +echo "Then wait 5 seconds and disconnect power." +echo "-----------------------------------------------" +echo "stop lnd - please wait .." +sudo systemctl stop lnd +echo "stop ${network}d (1) - please wait .." +sudo -u bitcoin ${network}-cli stop +sleep 10 +echo "stop ${network}d (2) - please wait .." +sudo systemctl stop ${network}d +sleep 3 +sync +echo "starting shutdown ..." +sudo shutdown -h now +exit 0