Update easy-fdmr.sh

main
hp3icc 2 months ago
parent 482911d988
commit 5e3cdca051

@ -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."

Loading…
Cancel
Save

Powered by TurnKey Linux.