mirror of
https://github.com/ShaYmez/hblink3-docker-install.git
synced 2025-12-22 13:39:50 +13:00
Address code review feedback: fix typo, menu height, and refactor pip helper
Co-authored-by: ShaYmez <76499782+ShaYmez@users.noreply.github.com>
This commit is contained in:
parent
89ade8cf14
commit
fcc314a46d
@ -95,8 +95,11 @@ install_docker_and_dependencies() {
|
||||
# Install docker-compose based on Debian version
|
||||
if [ $version -ge 12 ]; then
|
||||
# For Debian 12+ use docker-compose-plugin or install from GitHub
|
||||
# Note: We prefer docker-compose-plugin from apt repos when available for security
|
||||
apt-get install -y docker-compose-plugin 2>/dev/null || {
|
||||
echo "Installing docker-compose from GitHub releases..."
|
||||
# Fallback to GitHub releases for official Docker Compose binary
|
||||
# Downloaded from official Docker GitHub repository over HTTPS
|
||||
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
|
||||
@ -194,19 +197,24 @@ echo "--------------------------------------------------------------------------
|
||||
echo "Installing HBMonv2 configuration....."
|
||||
echo "------------------------------------------------------------------------------"
|
||||
sleep 2
|
||||
# Handle pip installation for different Debian versions
|
||||
|
||||
# Helper function to install pip packages with Debian 12+ compatibility
|
||||
pip_install() {
|
||||
local args="$@"
|
||||
if [ $VERSION -ge 12 ]; then
|
||||
# For Debian 12+, use --break-system-packages flag or virtual environment
|
||||
echo "Detected Debian 12+, using appropriate pip installation method..."
|
||||
pip3 install --break-system-packages setuptools wheel 2>/dev/null || pip3 install setuptools wheel
|
||||
pip3 install --break-system-packages -r requirements.txt 2>/dev/null || pip3 install -r requirements.txt
|
||||
pip3 install --break-system-packages attrs --force 2>/dev/null || pip3 install attrs --force
|
||||
# For Debian 12+, try with --break-system-packages flag first
|
||||
pip3 install --break-system-packages $args 2>/dev/null || pip3 install $args
|
||||
else
|
||||
# For Debian 10-11, use standard pip installation
|
||||
pip3 install setuptools wheel
|
||||
pip3 install -r requirements.txt
|
||||
pip3 install attrs --force
|
||||
pip3 install $args
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Installing Python dependencies..."
|
||||
pip_install setuptools wheel
|
||||
pip_install -r requirements.txt
|
||||
pip_install attrs --force
|
||||
|
||||
echo Install /opt/HBMonv2/config.py ...
|
||||
cat << EOF > /opt/HBMonv2/config.py
|
||||
CONFIG_INC = True # Include HBlink stats
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
# Main MENU system.....
|
||||
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 14 \
|
||||
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:" 24 56 14 \
|
||||
1 " Stop HBlink " \
|
||||
2 " Start HBlink " \
|
||||
3 " Restart HBlink " \
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
# 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>
|
||||
# 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user