mirror of
https://github.com/mynodebtc/mynode.git
synced 2025-01-11 19:30:11 +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
|
else
|
||||||
# Service not found, reboot
|
# Service not found, reboot
|
||||||
echo "Unknown service, rebooting"
|
echo "Unknown service, rebooting"
|
||||||
|
/usr/bin/mynode_stop_critical_services.sh
|
||||||
reboot
|
reboot
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
@ -9,10 +9,7 @@ set -e
|
||||||
date
|
date
|
||||||
|
|
||||||
# Shut down main services to save memory and CPU
|
# Shut down main services to save memory and CPU
|
||||||
systemctl stop electrs
|
/usr/bin/mynode_stop_critical_services.sh
|
||||||
systemctl stop lnd
|
|
||||||
systemctl stop quicksync
|
|
||||||
systemctl stop bitcoind
|
|
||||||
|
|
||||||
# Check if any dpkg installs have failed and correct
|
# Check if any dpkg installs have failed and correct
|
||||||
dpkg --configure -a
|
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():
|
def reboot_device():
|
||||||
stop_bitcoind()
|
|
||||||
stop_lnd()
|
|
||||||
os.system("sync")
|
os.system("sync")
|
||||||
|
os.system("/usr/bin/mynode_stop_critical_services.sh")
|
||||||
os.system("reboot")
|
os.system("reboot")
|
||||||
|
|
||||||
|
|
||||||
def shutdown_device():
|
def shutdown_device():
|
||||||
stop_bitcoind()
|
|
||||||
stop_lnd()
|
|
||||||
os.system("sync")
|
os.system("sync")
|
||||||
|
os.system("/usr/bin/mynode_stop_critical_services.sh")
|
||||||
os.system("shutdown -h now")
|
os.system("shutdown -h now")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user