mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-23 21:18:07 +00:00
Add script to store core services
This commit is contained in:
parent
ddc80745f5
commit
86ee9c5dc4
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
17
rootfs/standard/usr/bin/mynode_stop_critical_services.sh
Executable file
17
rootfs/standard/usr/bin/mynode_stop_critical_services.sh
Executable 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
|
|
@ -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")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user