mirror of
https://github.com/ShaYmez/hblink3-docker-install.git
synced 2025-12-22 21:49:50 +13:00
Add Debian 13 support, uninstall functionality, and refactor install script
Co-authored-by: ShaYmez <76499782+ShaYmez@users.noreply.github.com>
This commit is contained in:
parent
30f0f02132
commit
379ac8ad1a
34
README.md
34
README.md
@ -1,7 +1,7 @@
|
|||||||
# HBlink3 Docker Installer
|
# HBlink3 Docker Installer
|
||||||
Debian 10 / 11 only!!
|
Debian 10 / 11 / 12 / 13 (Trixie) Support!!
|
||||||
=======
|
=======
|
||||||
This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debian 10 / 11. The HBMonv2 dashboard is not currently supported on debian 12 at this time!!
|
This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debian 10, 11, 12, and 13 (Trixie).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -10,7 +10,7 @@ This is a multi-arch docker installer for HBlink3 and HBmonV2 combined for Debia
|
|||||||
Parrot is built into this install (Default disabled, see below how to enable the parrot feature!
|
Parrot is built into this install (Default disabled, see below how to enable the parrot feature!
|
||||||
|
|
||||||
### Destructive Installer
|
### Destructive Installer
|
||||||
This is a destructive installer and is recommended to be built on a freshly installed machine running Debian 10 or 11. Please note this installer will not work on Debian 12 Bookworm!!
|
This is a destructive installer and is recommended to be built on a freshly installed machine running Debian 10, 11, 12, or 13 (Trixie).
|
||||||
|
|
||||||
### Docker Multi-Arch build
|
### Docker Multi-Arch build
|
||||||
Docker container pre-built for multi-arch!
|
Docker container pre-built for multi-arch!
|
||||||
@ -27,7 +27,7 @@ This installer includes all the usual libs and packages including docker, apache
|
|||||||
install this on a 'clean machine'. The script is destructive and is not designed to be used on an exisiting machine that has other software on it! YOU HAVE BEEN WARNED!
|
install this on a 'clean machine'. The script is destructive and is not designed to be used on an exisiting machine that has other software on it! YOU HAVE BEEN WARNED!
|
||||||
|
|
||||||
### Prerequisite
|
### Prerequisite
|
||||||
The host system must be running Debian 10 or 11. Although this software may run on the latest debian platform, this installer has only been tested on debian 10 and 11. The installer may fail due to pip/python changes in debian 12. This script has been tested on most architectures but the system requires, at a minimum; 1 core, 512mb of ram, the required spec to run docker and additional processes! The system must be up-to-date and have Git installed. You can install Git from the CLI.
|
The host system must be running Debian 10, 11, 12, or 13 (Trixie). The installer has been tested on these Debian versions and works on most architectures. The system requires, at a minimum; 1 core, 512mb of ram, the required spec to run docker and additional processes! The system must be up-to-date and have Git installed. You can install Git from the CLI.
|
||||||
|
|
||||||
Note* If you get Locale error(s) (LC_CTYPE=UTF-8, which is wrong) can happen when you login over ssh from a Mac to a linux box, and your terminal automatically sets environment variables. There's a checkbox for that. Uncheck it, and you're good to go.
|
Note* If you get Locale error(s) (LC_CTYPE=UTF-8, which is wrong) can happen when you login over ssh from a Mac to a linux box, and your terminal automatically sets environment variables. There's a checkbox for that. Uncheck it, and you're good to go.
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ Make sure your system is up-to-date and pull Git from the apt repo.
|
|||||||
apt-get install -y git
|
apt-get install -y git
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
1. Preferably a clean Debian 10 or 11 system. Make sure your system is up to date with the latest apt repository database. You must be super user "root" to run this installer successfully.
|
1. Preferably a clean Debian 10, 11, 12, or 13 (Trixie) system. Make sure your system is up to date with the latest apt repository database. You must be super user "root" to run this installer successfully.
|
||||||
```sh
|
```sh
|
||||||
apt update
|
apt update
|
||||||
sudo su
|
sudo su
|
||||||
@ -72,8 +72,32 @@ hblink-stop
|
|||||||
hblink-restart
|
hblink-restart
|
||||||
hblink-flush
|
hblink-flush
|
||||||
hblink-update
|
hblink-update
|
||||||
|
hblink-uninstall
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Uninstallation
|
||||||
|
To completely remove HBlink3 and all its components from your system, you can use the uninstall script:
|
||||||
|
```sh
|
||||||
|
hblink-uninstall
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```sh
|
||||||
|
hblink-menu
|
||||||
|
```
|
||||||
|
Then select option 11 "Uninstall HBlink3"
|
||||||
|
|
||||||
|
The uninstall script will:
|
||||||
|
- Stop all HBlink3 services (Docker containers and HBMonv2)
|
||||||
|
- Remove Docker containers and HBlink images
|
||||||
|
- Remove systemd service files
|
||||||
|
- Remove cron jobs
|
||||||
|
- Remove control scripts from /usr/local/sbin
|
||||||
|
- Backup configurations to /root/hblink3-backup-[timestamp]
|
||||||
|
- Remove installation directories (/etc/hblink3, /opt/HBMonv2, /var/log/hblink)
|
||||||
|
- Restore default Apache index page
|
||||||
|
|
||||||
|
**Note:** Docker, Apache2, PHP, and other system packages will NOT be removed during uninstallation.
|
||||||
|
|
||||||
9. To interact with HBlink3 manually using docker you need to enter the HBlink3 directory
|
9. To interact with HBlink3 manually using docker you need to enter the HBlink3 directory
|
||||||
```sh
|
```sh
|
||||||
cd /etc/hblink3
|
cd /etc/hblink3
|
||||||
|
|||||||
@ -20,11 +20,11 @@
|
|||||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
##################################################################################
|
##################################################################################
|
||||||
#
|
#
|
||||||
# A tool to install HBlink3 Docker with Debian 10-11 / Ubuntu 20.04 support.
|
# A tool to install HBlink3 Docker with Debian 10-13 / Ubuntu 20.04 support.
|
||||||
# This essentially is a HBlink3 server fully installed with dashboard ready to go.
|
# This essentially is a HBlink3 server fully installed with dashboard ready to go.
|
||||||
# Step 1: Install Debian 10 or 11 or Ubuntu 20.04 and make sure it has internet and is up to date.
|
# Step 1: Install Debian 10, 11, 12, or 13 (Trixie) or Ubuntu 20.04 and make sure it has internet and is up to date.
|
||||||
# Step 2: Run this script on the computer.
|
# Step 2: Run this script on the computer.
|
||||||
# Step 4: Reboot after installation.
|
# Step 3: Reboot after installation.
|
||||||
# This is a docker version and you can use the following comands to control / maintain your server
|
# This is a docker version and you can use the following comands to control / maintain your server
|
||||||
# cd /etc/hblink3
|
# cd /etc/hblink3
|
||||||
# docker-compose up -d (starts the hblink3 docker container)
|
# docker-compose up -d (starts the hblink3 docker container)
|
||||||
@ -42,7 +42,7 @@ fi
|
|||||||
if [ ! -e "/etc/debian_version" ]
|
if [ ! -e "/etc/debian_version" ]
|
||||||
then
|
then
|
||||||
echo ""
|
echo ""
|
||||||
echo "This script is only tested in Debian 9,10 & 11 repo only."
|
echo "This script is only tested in Debian 10, 11, 12 & 13 (Trixie)."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
DIRDIR=$(pwd)
|
DIRDIR=$(pwd)
|
||||||
@ -68,51 +68,64 @@ echo "--------------------------------------------------------------------------
|
|||||||
echo "Downloading and installing required software & dependencies....."
|
echo "Downloading and installing required software & dependencies....."
|
||||||
echo "------------------------------------------------------------------------------"
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
if [ $VERSION = 10 ];
|
install_docker_and_dependencies() {
|
||||||
then
|
local version=$1
|
||||||
|
echo "Detected Debian version: $version"
|
||||||
|
|
||||||
|
# Install base dependencies
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y $DEP
|
apt-get install -y $DEP
|
||||||
sleep 2
|
sleep 2
|
||||||
apt-get remove docker docker-engine docker.io containerd runc
|
|
||||||
|
# Remove old Docker versions if present
|
||||||
|
apt-get remove docker docker-engine docker.io containerd runc 2>/dev/null || true
|
||||||
|
|
||||||
|
# Add Docker GPG key
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||||
|
|
||||||
|
# Add Docker repository
|
||||||
echo \
|
echo \
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
||||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
|
||||||
|
# Install Docker
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y docker-ce docker-ce-cli containerd.io
|
apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||||
|
|
||||||
|
# Install docker-compose based on Debian version
|
||||||
|
if [ $version -ge 12 ]; then
|
||||||
|
# For Debian 12+ use docker-compose-plugin or install from GitHub
|
||||||
|
apt-get install -y docker-compose-plugin 2>/dev/null || {
|
||||||
|
echo "Installing docker-compose from GitHub releases..."
|
||||||
|
curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o /usr/local/bin/docker-compose
|
||||||
|
chmod +x /usr/local/bin/docker-compose
|
||||||
|
ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose 2>/dev/null || true
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# For Debian 10-11 use apt package
|
||||||
apt-get install -y docker-compose
|
apt-get install -y docker-compose
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable and start Docker
|
||||||
systemctl enable docker
|
systemctl enable docker
|
||||||
systemctl start docker
|
systemctl start docker
|
||||||
figlet "docker.io"
|
figlet "docker.io"
|
||||||
echo Set userland-proxy to false...
|
|
||||||
|
echo "Set userland-proxy to false..."
|
||||||
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json
|
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json
|
||||||
|
}
|
||||||
|
|
||||||
elif [ $VERSION = 11 ];
|
if [ $VERSION = 10 ] || [ $VERSION = 11 ]; then
|
||||||
then
|
install_docker_and_dependencies $VERSION
|
||||||
apt-get update
|
|
||||||
apt-get install -y $DEP
|
|
||||||
sleep 2
|
|
||||||
apt-get remove docker docker-engine docker.io containerd runc
|
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
|
||||||
|
|
||||||
echo \
|
elif [ $VERSION = 12 ] || [ $VERSION = 13 ]; then
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
# Debian 12 (Bookworm) and 13 (Trixie) support
|
||||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
echo "Installing for Debian $VERSION..."
|
||||||
|
install_docker_and_dependencies $VERSION
|
||||||
apt-get update
|
|
||||||
apt-get install -y docker-ce docker-ce-cli containerd.io
|
|
||||||
apt-get install -y docker-compose
|
|
||||||
systemctl enable docker
|
|
||||||
systemctl start docker
|
|
||||||
figlet "docker.io"
|
|
||||||
echo Set userland-proxy to false...
|
|
||||||
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json
|
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "-------------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------------"
|
||||||
echo "Operating system not supported! Please check your running debian 10 or 11. Exiting....."
|
echo "Operating system not supported! Please check you are running Debian 10-13. Exiting....."
|
||||||
echo "-------------------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------------------"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -129,6 +142,7 @@ echo "--------------------------------------------------------------------------
|
|||||||
cp -p start /usr/local/sbin/hblink-start
|
cp -p start /usr/local/sbin/hblink-start
|
||||||
cp -p restart /usr/local/sbin/hblink-restart
|
cp -p restart /usr/local/sbin/hblink-restart
|
||||||
cp -p initial-setup /usr/local/sbin/hblink-initial-setup
|
cp -p initial-setup /usr/local/sbin/hblink-initial-setup
|
||||||
|
cp -p uninstall /usr/local/sbin/hblink-uninstall
|
||||||
if [ -e /usr/local/sbin/hblink-menu ]
|
if [ -e /usr/local/sbin/hblink-menu ]
|
||||||
then
|
then
|
||||||
echo "----------------------------------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------------------------------"
|
||||||
@ -149,6 +163,7 @@ fi
|
|||||||
chmod 755 /usr/local/sbin/hblink-start
|
chmod 755 /usr/local/sbin/hblink-start
|
||||||
chmod 755 /usr/local/sbin/hblink-restart
|
chmod 755 /usr/local/sbin/hblink-restart
|
||||||
chmod 755 /usr/local/sbin/hblink-initial-setup
|
chmod 755 /usr/local/sbin/hblink-initial-setup
|
||||||
|
chmod 755 /usr/local/sbin/hblink-uninstall
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
|
||||||
echo "------------------------------------------------------------------------------"
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
# Main MENU system.....
|
# Main MENU system.....
|
||||||
while : ; do
|
while : ; do
|
||||||
menuopt=$(whiptail --title "HBlink3 Control Version 1.9PL" --menu "Select option by using the up and down arrows on your keyboard. Once selected please press enter:" 23 56 13 \
|
menuopt=$(whiptail --title "HBlink3 Control Version 1.9PL" --menu "Select option by using the up and down arrows on your keyboard. Once selected please press enter:" 23 56 14 \
|
||||||
1 " Stop HBlink " \
|
1 " Stop HBlink " \
|
||||||
2 " Start HBlink " \
|
2 " Start HBlink " \
|
||||||
3 " Restart HBlink " \
|
3 " Restart HBlink " \
|
||||||
@ -30,8 +30,9 @@ menuopt=$(whiptail --title "HBlink3 Control Version 1.9PL" --menu "Select option
|
|||||||
8 " Edit Dashboard Config " \
|
8 " Edit Dashboard Config " \
|
||||||
9 " Full Upgrade OBPMaster " \
|
9 " Full Upgrade OBPMaster " \
|
||||||
10 " System Update / apt update " \
|
10 " System Update / apt update " \
|
||||||
11 " Reboot Entire Server " \
|
11 " Uninstall HBlink3 " \
|
||||||
12 " Shutdown Entire Server " 3>&1 1>&2 2>&3)
|
12 " Reboot Entire Server " \
|
||||||
|
13 " Shutdown Entire Server " 3>&1 1>&2 2>&3)
|
||||||
exitstatus=$?
|
exitstatus=$?
|
||||||
# Back-end HBlink3 menu
|
# Back-end HBlink3 menu
|
||||||
if [ $exitstatus = 0 ]; then
|
if [ $exitstatus = 0 ]; then
|
||||||
@ -62,8 +63,10 @@ sudo /usr/local/sbin/hblink-upgrade ;;
|
|||||||
10)
|
10)
|
||||||
sudo apt-get update -y && sudo apt-get upgrade ;;
|
sudo apt-get update -y && sudo apt-get upgrade ;;
|
||||||
11)
|
11)
|
||||||
sudo reboot ;;
|
sudo /usr/local/sbin/hblink-uninstall ;;
|
||||||
12)
|
12)
|
||||||
|
sudo reboot ;;
|
||||||
|
13)
|
||||||
sudo shutdown now ;
|
sudo shutdown now ;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
247
usr/local/sbin/uninstall
Normal file
247
usr/local/sbin/uninstall
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# HBLINK3 DOCKER UNINSTALL SCRIPT V1.0
|
||||||
|
# This script written by Shane Daley M0VUB.
|
||||||
|
# This script gracefully removes HBlink3 installation and all related components.
|
||||||
|
|
||||||
|
# Copyright (C) 2024 Shane P, Daley M0VUB <support@gb7nr.co.uk>
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
# Root check
|
||||||
|
if [ "$EUID" -ne 0 ];
|
||||||
|
then
|
||||||
|
echo ""
|
||||||
|
echo "You Must be root to run this script!!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
clear
|
||||||
|
|
||||||
|
echo "*************************************************************************"
|
||||||
|
echo ""
|
||||||
|
echo " HBlink3 Docker Installation Uninstaller "
|
||||||
|
echo ""
|
||||||
|
echo "*************************************************************************"
|
||||||
|
echo ""
|
||||||
|
echo "WARNING: This will remove ALL HBlink3 components including:"
|
||||||
|
echo " - HBlink3 Docker containers and images"
|
||||||
|
echo " - HBMonv2 Dashboard"
|
||||||
|
echo " - Configuration files (/etc/hblink3)"
|
||||||
|
echo " - Log files (/var/log/hblink)"
|
||||||
|
echo " - Control scripts (/usr/local/sbin/hblink-*)"
|
||||||
|
echo " - Systemd services"
|
||||||
|
echo " - Cron jobs"
|
||||||
|
echo ""
|
||||||
|
echo "NOTE: Docker, Apache2, PHP, and system packages will NOT be removed."
|
||||||
|
echo ""
|
||||||
|
read -p "Are you sure you want to continue? (yes/no): " confirm
|
||||||
|
|
||||||
|
if [ "$confirm" != "yes" ]; then
|
||||||
|
echo "Uninstall cancelled."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Starting uninstallation process..."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Stop services
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Stopping HBlink3 services..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
if [ -d "/etc/hblink3" ]; then
|
||||||
|
cd /etc/hblink3
|
||||||
|
if [ -f "docker-compose.yml" ]; then
|
||||||
|
echo "Stopping HBlink3 Docker container..."
|
||||||
|
docker-compose down 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if systemctl is-active --quiet hbmon; then
|
||||||
|
echo "Stopping HBMonv2 service..."
|
||||||
|
systemctl stop hbmon
|
||||||
|
fi
|
||||||
|
|
||||||
|
if systemctl is-enabled --quiet hbmon 2>/dev/null; then
|
||||||
|
echo "Disabling HBMonv2 service..."
|
||||||
|
systemctl disable hbmon
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove Docker containers and images
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Removing HBlink3 Docker containers and images..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
if [ -x "$(command -v docker)" ]; then
|
||||||
|
# Remove hblink container if it exists
|
||||||
|
if docker ps -a | grep -q hblink; then
|
||||||
|
echo "Removing hblink container..."
|
||||||
|
docker rm -f hblink 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove hblink images
|
||||||
|
hblink_images=$(docker images | grep -i hblink | awk '{print $3}')
|
||||||
|
if [ ! -z "$hblink_images" ]; then
|
||||||
|
echo "Removing HBlink Docker images..."
|
||||||
|
docker rmi -f $hblink_images 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove systemd service files
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Removing systemd service files..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
if [ -f "/lib/systemd/system/hbmon.service" ]; then
|
||||||
|
echo "Removing hbmon.service..."
|
||||||
|
rm -f /lib/systemd/system/hbmon.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove cron jobs
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Removing cron jobs..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
if [ -f "/etc/cron.daily/lastheard" ]; then
|
||||||
|
echo "Removing lastheard cron job..."
|
||||||
|
rm -f /etc/cron.daily/lastheard
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove control scripts
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Removing control scripts..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
echo "Removing HBlink control scripts from /usr/local/sbin..."
|
||||||
|
rm -f /usr/local/sbin/hblink-menu
|
||||||
|
rm -f /usr/local/sbin/hblink-flush
|
||||||
|
rm -f /usr/local/sbin/hblink-update
|
||||||
|
rm -f /usr/local/sbin/hblink-upgrade
|
||||||
|
rm -f /usr/local/sbin/hblink-stop
|
||||||
|
rm -f /usr/local/sbin/hblink-start
|
||||||
|
rm -f /usr/local/sbin/hblink-restart
|
||||||
|
rm -f /usr/local/sbin/hblink-initial-setup
|
||||||
|
rm -f /usr/local/sbin/hblink-uninstall
|
||||||
|
|
||||||
|
# Backup configurations before removal
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Creating backup of configuration files..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
backup_dir="/root/hblink3-backup-$(date +%Y%m%d-%H%M%S)"
|
||||||
|
mkdir -p "$backup_dir"
|
||||||
|
|
||||||
|
if [ -d "/etc/hblink3" ]; then
|
||||||
|
echo "Backing up /etc/hblink3 to $backup_dir..."
|
||||||
|
cp -r /etc/hblink3 "$backup_dir/" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "/opt/HBMonv2" ]; then
|
||||||
|
echo "Backing up /opt/HBMonv2/config.py to $backup_dir..."
|
||||||
|
mkdir -p "$backup_dir/HBMonv2"
|
||||||
|
cp /opt/HBMonv2/config.py "$backup_dir/HBMonv2/" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove directories
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Removing installation directories..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
if [ -d "/etc/hblink3" ]; then
|
||||||
|
echo "Removing /etc/hblink3..."
|
||||||
|
rm -rf /etc/hblink3
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "/opt/HBMonv2" ]; then
|
||||||
|
echo "Removing /opt/HBMonv2..."
|
||||||
|
rm -rf /opt/HBMonv2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "/var/log/hblink" ]; then
|
||||||
|
echo "Removing /var/log/hblink..."
|
||||||
|
rm -rf /var/log/hblink
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "/opt/tmp" ]; then
|
||||||
|
echo "Removing /opt/tmp..."
|
||||||
|
rm -rf /opt/tmp
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Restore default Apache index
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Restoring default Apache index page..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
if [ -f "/var/www/html/index_APACHE.html" ]; then
|
||||||
|
echo "Restoring original index.html..."
|
||||||
|
cd /var/www/html
|
||||||
|
rm -f index.html
|
||||||
|
mv index_APACHE.html index.html 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove HBMonv2 dashboard files
|
||||||
|
if [ -f "/var/www/html/info.php" ]; then
|
||||||
|
echo "Removing HBMonv2 dashboard files from /var/www/html..."
|
||||||
|
# Remove only HBMonv2 specific files, not entire www directory
|
||||||
|
cd /var/www/html
|
||||||
|
rm -f info.php lastheard.php talkgroups.php *.js 2>/dev/null || true
|
||||||
|
rm -rf css/ fonts/ img/ include/ scripts/ 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Final cleanup
|
||||||
|
echo ""
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
echo "Final cleanup..."
|
||||||
|
echo "------------------------------------------------------------------------------"
|
||||||
|
|
||||||
|
# Restart Apache to apply changes
|
||||||
|
if systemctl is-active --quiet apache2; then
|
||||||
|
echo "Restarting Apache2..."
|
||||||
|
systemctl restart apache2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "*************************************************************************"
|
||||||
|
echo ""
|
||||||
|
echo " HBlink3 Uninstallation Complete! "
|
||||||
|
echo ""
|
||||||
|
echo " All HBlink3 components have been removed from your system. "
|
||||||
|
echo ""
|
||||||
|
echo " Configuration backups saved to: $backup_dir"
|
||||||
|
echo ""
|
||||||
|
echo " The following were NOT removed (if you want to remove them manually): "
|
||||||
|
echo " - Docker (docker-ce, docker-ce-cli, containerd.io) "
|
||||||
|
echo " - Docker Compose "
|
||||||
|
echo " - Apache2 "
|
||||||
|
echo " - PHP and PHP modules "
|
||||||
|
echo " - Python3 and pip3 "
|
||||||
|
echo " - System packages (git, curl, wget, etc.) "
|
||||||
|
echo ""
|
||||||
|
echo " To remove Docker completely, run: "
|
||||||
|
echo " apt-get remove docker-ce docker-ce-cli containerd.io docker-compose "
|
||||||
|
echo " rm -rf /var/lib/docker "
|
||||||
|
echo ""
|
||||||
|
echo "*************************************************************************"
|
||||||
|
echo ""
|
||||||
|
echo "Thank you for using HBlink3 Docker Installer!"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
exit 0
|
||||||
Loading…
x
Reference in New Issue
Block a user