Add script to store core services

This commit is contained in:
Taylor Helsper 2019-12-18 21:45:44 -06:00
parent ddc80745f5
commit 86ee9c5dc4
4 changed files with 21 additions and 8 deletions

View File

@ -53,6 +53,7 @@ if [ "$#" -ge 2 ]; then
else
# Service not found, reboot
echo "Unknown service, rebooting"
/usr/bin/mynode_stop_critical_services.sh
reboot
fi
else

View File

@ -9,10 +9,7 @@ set -e
date
# Shut down main services to save memory and CPU
systemctl stop electrs
systemctl stop lnd
systemctl stop quicksync
systemctl stop bitcoind
/usr/bin/mynode_stop_critical_services.sh
# Check if any dpkg installs have failed and correct
dpkg --configure -a

View File

@ -0,0 +1,17 @@
#!/bin/bash
# Stop additional services
systemctl stop glances
systemctl stop lndhub
systemctl stop netdata
systemctl stop glances
systemctl stop rtl
systemctl stop webssh2
# Stop core services
systemctl stop electrs
systemctl stop lnd
systemctl stop quicksync
systemctl stop bitcoind
sync

View File

@ -214,16 +214,14 @@ def delete_lnd_data():
def reboot_device():
stop_bitcoind()
stop_lnd()
os.system("sync")
os.system("/usr/bin/mynode_stop_critical_services.sh")
os.system("reboot")
def shutdown_device():
stop_bitcoind()
stop_lnd()
os.system("sync")
os.system("/usr/bin/mynode_stop_critical_services.sh")
os.system("shutdown -h now")