#!/bin/bash # HBLINK3 DOCKER CONTROL SCRIPTS V2.0 # Version 13122025 # 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. # Add to the cron tab for auto execution # Copyright (C) 2020-2025 Shane P. Daley M0VUB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # Update containers / service clean/truncate/ and restart of services.. LOCAL_IP=$(ip a | grep inet | grep "eth0\|en" | awk '{print $2}' | tr '/' ' ' | awk '{print $1}') ARC=$(lscpu | grep Arch | awk '{print $2}') VERSION=$(sed 's/\..*//' /etc/debian_version) clear echo Starting update..... sleep 1 echo "." sleep 1 echo ".." sleep 1 echo "..." echo Stopping HBlink3..... cd /etc/hblink3 docker-compose down echo Removing all docker images..... docker rmi $(docker images -q -a) --force figlet "ShaYmez." sleep 1 echo Flushing services and restarting..... /usr/local/sbin/hblink-flush echo "Done." echo "" echo "" echo "*************************************************************************" echo "" echo " The HBlink3 Docker Update Is Complete! " echo "" echo " ******* To Upgrade run 'hblink-upgrade ******* " echo "" echo " Use 'docker container logs hblink' to check the status. " echo " logs are parked in /var/log/hblink. " echo " Just make sure this computer can be accessed over UDP specified port " echo " You will need to edit your config and then run the following command " echo "" echo " Type 'hblink-menu' for main menu " echo " Use the menu to edit your server / config " echo " Refer to the official HBlink Repo for more documentation " echo " https://github.com/HBLink-org/hblink3 " echo "" echo " Check out the docker installer of HBlink3 here " echo " https://github.com/ShaYmez/hblink3-docker-install " echo "" echo " Your IP address is $LOCAL_IP " echo "" echo " Your running on $ARC with Debian $VERSION " echo "" echo " Thanks for using this script. " echo " Copyright © 2025 Shane Daley - M0VUB " echo " More information can be found @ https://freestar.network/development " echo "" echo "*************************************************************************"