Update flush

Revive flush script to comply with HBlink3 install
This commit is contained in:
M0VUB 2023-01-02 21:07:42 +00:00 committed by GitHub
parent 695ee65ca1
commit 2eccc31198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# OBP-MASTER FORMERLY RYSEN MASTER+ (HBlink3) A FORK OF THE FREEDMR / HBLINK PROJECT # HBLINK3 DOCKER CONTROL SCRIPTS V1.9
# This script written by Shane Daley M0VUB. The script gracefully shutsdown services while services are cleaned and logs are truncated. # This script written by Shane Daley M0VUB. The script gracefully shuts down services while services are cleaned and logs are truncated.
# We can also add items in this script for future use like updates or further log trims. # We can also add items in this script for future use like updates or further log trims.
# Add to the cron tab for auto execution # Add to the cron tab for auto execution
@ -17,43 +17,35 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# Flush routine for HBlink3 (ShaYmez docker only)
# Start service clean/truncate/ and restart of services. # Start service clean/truncate/ and restart of services.
echo "Stopping services....." echo "Stopping services....."
sleep 2 sleep 1
echo "Stopping OBP MasterServer (If not already stopped)...." echo "Stopping HBlink3 (If not already stopped)...."
cd /etc/hblink3 cd /etc/hblink3
docker-compose down docker-compose down
echo "Done." echo "Done."
sleep 1 sleep 1
echo "Stopping HBMonitor....." echo "Stopping Dashboard....."
systemctl stop hbmon systemctl stop hbmon
echo "Done." echo "Done."
sleep 1 sleep 1
echo "OBP MasterServer Flush and maintenance loop starting....." echo "HBlink3 Flush and maintenance loop starting....."
sleep 1 sleep 1
echo "Starting truncate main log folder /var/log....." echo "Starting truncate main log folder /var/log....."
truncate -s 0 /var/log/*log truncate -s 0 /var/log/*log
echo "Starting truncate OBP entire log /var/log/hblink....." echo "Starting truncate HBlink3 entire log /var/log/hblink....."
truncate -s 0 /var/log/hblink/*log && truncate -s 0 /var/log/hblink/*log
echo "Starting truncate Lastheard....." echo "Starting truncate Lastheard....."
truncate -s 0 /opt/HBmonitor/log/*log truncate -s 0 /opt/HBMonv2/log/*log
echo "Flushing JSON files....."
echo "/etc/hblink3/json....."
rm /etc/hblink3/json/peer_ids.json
rm /etc/hblink3/json/subscriber_ids.json
#Get JSON files..
curl https://freestar.network/downloads/subscriber_ids.json -o /etc/hblink3/json/subscriber_ids.json
curl https://freestar.network/downloads/peer_ids.json -o /etc/hblink3/json/peer_ids.json
echo "JSON files will be downloaded from freestar.network....."
figlet "FreeSTAR CL OBP V1.9"
#Restart all services gracefully #Restart all services gracefully
echo "Restart all services....." echo "Restart all services....."
@ -69,7 +61,7 @@ systemctl restart apache2
echo "Done." echo "Done."
sleep 1 sleep 1
echo "Starting OBP MasterServer....." echo "Starting HBlink3....."
sleep 1 sleep 1
echo . echo .
sleep 1 sleep 1
@ -79,10 +71,10 @@ echo ...
docker-compose up -d docker-compose up -d
sleep 1 sleep 1
figlet "OBP Master." figlet "HBlink 3"
sleep 1 sleep 1
echo "Checking OBP is composed....." echo "Checking HBlink is composed....."
sleep 1 sleep 1
docker ps docker ps
@ -95,9 +87,9 @@ echo "Flushing network tracking table....."
conntrack -F conntrack -F
sleep 1 sleep 1
echo "Starting HBmonitor....." echo "Starting Dasdhboard....."
systemctl restart hbmon systemctl restart hbmon
figlet "HBmonitor3" figlet "HBMonv2"
echo "Done." echo "Done."
sleep 1 sleep 1
@ -108,7 +100,7 @@ sleep 1
echo .. echo ..
sleep 1 sleep 1
echo ... echo ...
echo "OBP MasterServer is now online. Flush is complete and you may now exit. AKA ShaYmez." echo "HBlink 3 is now online. Flush is complete and you may now exit. AKA ShaYmez."
# #
# This script has been developed by the one and only ShaYmez. Visit https://repo.radio/ShaYmez for more super scripts! # This script has been developed by the one and only ShaYmez. Visit https://repo.radio/ShaYmez for more super scripts!
echo "All systems have been flushed/cleaned and ready to go. Aka Dr. Node. ShaYmez, OBP MasterServer" echo "All systems have been flushed/cleaned and ready to go. Aka Dr. Node. ShaYmez, OBP MasterServer"