From 5e3cdca0513c931e656f8cbd5f91157b45aba25a Mon Sep 17 00:00:00 2001 From: hp3icc Date: Tue, 14 Oct 2025 06:28:03 -0500 Subject: [PATCH] Update easy-fdmr.sh --- easy-fdmr.sh | 49 ++++++++++++++++--------------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/easy-fdmr.sh b/easy-fdmr.sh index 15bfa05..3b3da98 100644 --- a/easy-fdmr.sh +++ b/easy-fdmr.sh @@ -48,55 +48,38 @@ for app in $apps; do check_and_install "$app" done -# === CREAR ENTORNO VIRTUAL PYTHON === -cd /opt/ -python3 -m venv myenv -source myenv/bin/activate -python3 -m ensurepip --upgrade || wget -qO- https://bootstrap.pypa.io/get-pip.py | python3 -pip install --no-input --upgrade pip setuptools wheel -deactivate - -# === DETECTAR SISTEMA OPERATIVO === -if [ -f "/etc/os-release" ]; then - . /etc/os-release - OS=$ID - VERSION=$VERSION_ID - CODENAME=$VERSION_CODENAME -else - OS="unknown" - VERSION="0" - CODENAME="" -fi -echo "Detectado: OS=$OS, VERSION=$VERSION, CODENAME=$CODENAME" - # === INSTALACIÓN DE MÓDULOS PYTHON === PACKAGES="pyOpenSSL requests autobahn jinja2 dmr-utils3 ansi2html aprslib tinydb mysqlclient setproctitle pynmea2 maidenhead spyne \ Pyro5 bitstring bitarray dmr_utils3 configparser resettabletimer setuptools wheel MarkupSafe service-identity gTTS" PIP_BASE_CMD="/usr/bin/python3 -m pip install --no-input --root-user-action=ignore --disable-pip-version-check" +PIP_BASE_CMD2="/usr/bin/python3 -m pip install --upgrade --no-input --disable-pip-version-check" -if [ "$OS" == "debian" ] && { [ "$VERSION" == "13" ] || [ "$CODENAME" == "trixie" ]; }; then - echo "Usando instalación con --break-system-packages (Debian $VERSION)" +if grep -q "VERSION_ID=\"1[3]\"" /etc/os-release; then + version=$(grep 'VERSION_ID=' /etc/os-release | cut -d '"' -f 2) + echo "Detected Debian $version" # Para Debian 13: Instalar TODOS los paquetes EXCEPTO requests sudo $PIP_BASE_CMD --break-system-packages ${PACKAGES//requests/} || true # Twisted se usa de repositorio en Debian 13 sudo $PIP_BASE_CMD --break-system-packages "Twisted>=23.10.0" || true sudo $PIP_BASE_CMD --break-system-packages "autobahn" || true - -elif [ "$OS" == "debian" ] && { [ "$VERSION" == "12" ]; }; then - echo "Usando instalación con --break-system-packages (Debian $VERSION)" - sudo $PIP_BASE_CMD --break-system-packages $PACKAGES || true +fi +if grep -q "VERSION_ID=\"1[2]\"" /etc/os-release; then + version=$(grep 'VERSION_ID=' /etc/os-release | cut -d '"' -f 2) + echo "Detected Debian $version" + sudo $PIP_BASE_CMD --break-system-packages $PACKAGES || true # Para Debian 12: Reforzar instalación de requests # Forzar reinstalación de Twisted específico sudo $PIP_BASE_CMD --break-system-packages "Twisted==22.10.0" || true sudo $PIP_BASE_CMD --break-system-packages "autobahn" || true - -else - echo "Usando instalación estándar" - sudo $PIP_BASE_CMD $PACKAGES || true +fi +if ! grep -q "VERSION_ID=\"1[23]\"" /etc/os-release; then + version=$(grep 'VERSION_ID=' /etc/os-release | cut -d '"' -f 2) + echo "Detected Debian $version" + sudo $PIP_BASE_CMD2 $PACKAGES || true # Para otros sistemas: Reforzar instalación de requests - sudo $PIP_BASE_CMD "Twisted==22.10.0" || true - sudo $PIP_BASE_CMD "autobahn" || true + sudo $PIP_BASE_CMD2 "Twisted==22.10.0" || true + sudo $PIP_BASE_CMD2 "autobahn" || true fi echo "✅ Instalación de módulos Python completada."