Update easy-fdmr.sh

merge-requests/1/head
Esteban Mackay Q 2 years ago
parent a12f189e17
commit e059340f83

@ -5,35 +5,24 @@ if [[ $EUID -ne 0 ]]; then
echo "Este script debe ejecutarse como usuario ROOT" echo "Este script debe ejecutarse como usuario ROOT"
exit 1 exit 1
fi fi
# Actualizar la lista de paquetes una vez al principio # Actualizar la lista de paquetes una vez al principio
apt-get update && apt-get upgrade -y apt-get update && apt-get upgrade -y
# Lista de aplicaciones para verificar e instalar
apps=("sudo" "curl" "git" "make" "build-essential" "libusb-1.0-0-dev" "python" "python3" "python3-pip" "chkconfig" "git-core" "libi2c-dev" "i2c-tools" "lm-sensors" "python3-websockets" "python3-gpiozero" "python3-psutil" "python3-serial" "wget" "sudo" "python3-dev" "python3-venv" "libffi-dev" "libssl-dev" "cargo" "pkg-config" "sed" "default-libmysqlclient-dev" "libmysqlclient-dev" "build-essential" "zip" "unzip" "python3-distutils" "python3-twisted" "python3-bitarray" "rrdtool" "openssl" "wavemon" "gcc" "g++" "cmake" "libasound2-dev" "libudev-dev" "gpsd" "libgps-dev" "gpsd-clients" "gpsd-tools" "chrony")
# Función para verificar e instalar una aplicación # Función para verificar e instalar una aplicación
check_and_install() { check_and_install() {
app=$1 app=$1
if ! dpkg -s $app >/dev/null 2>&1; then if ! dpkg -s $app 2>/dev/null | grep -q "Status: install ok installed"; then
echo "$app no está instalado. Instalando..." echo "$app no está instalado. Instalando..."
sudo apt-get install $app -y sudo apt-get install -y $app
echo "$app instalado correctamente." echo "$app instalado correctamente."
else else
echo "Verificando si hay actualizaciones para $app..." echo "$app ya está instalado."
available_version=$(apt-cache policy $app | grep 'Candidate' | awk '{print $2}')
current_version=$(dpkg -s $app | grep 'Version' | awk '{print $2}')
if [ "$available_version" != "$current_version" ]; then
echo "Hay una versión actualizada de $app disponible. Actualizando..."
sudo apt-get install --only-upgrade $app -y
echo "$app actualizado correctamente."
else
echo "$app ya está instalado y actualizado."
fi
fi fi
} }
# Lista de aplicaciones para verificar e instalar
apps=("git" "make" "build-essential" "libusb-1.0-0-dev" "python" "python3" "python3-pip" "chkconfig" "git-core" "libi2c-dev" "i2c-tools" "lm-sensors" "python3-websockets" "python3-gpiozero" "python3-psutil" "python3-serial" "wget" "sudo" "python3-dev" "python3-venv" "libffi-dev" "libssl-dev" "cargo" "pkg-config" "sed" "default-libmysqlclient-dev" "libmysqlclient-dev" "build-essential" "zip" "unzip" "python3-distutils" "python3-twisted" "python3-bitarray" "rrdtool" "openssl" "wavemon" "gcc" "g++" "cmake" "libasound2-dev" "libudev-dev" "gpsd" "libgps-dev" "gpsd-clients" "gpsd-tools" "chrony")
# Verificar e instalar cada aplicación # Verificar e instalar cada aplicación
for app in "${apps[@]}"; do for app in "${apps[@]}"; do
check_and_install $app check_and_install $app
@ -42,7 +31,7 @@ done
# Verificar y actualizar python3-venv si no está instalado # Verificar y actualizar python3-venv si no está instalado
if ! dpkg -s python3-venv >/dev/null 2>&1; then if ! dpkg -s python3-venv >/dev/null 2>&1; then
echo "python3-venv no está instalado. Instalando..." echo "python3-venv no está instalado. Instalando..."
sudo apt-get install python3-venv -y apt-get install python3-venv -y
echo "python3-venv instalado correctamente." echo "python3-venv instalado correctamente."
fi fi
@ -52,13 +41,26 @@ python3 -m venv myenv
source myenv/bin/activate source myenv/bin/activate
# Instalar pip en el entorno virtual # Instalar pip en el entorno virtual
if [ -f "/opt/get-pip.py" ]
then
rm /opt/get-pip.*
fi
wget https://bootstrap.pypa.io/pip/get-pip.py wget https://bootstrap.pypa.io/pip/get-pip.py
python3 get-pip.py python3 get-pip.py
rm get-pip.py rm get-pip.*
# Instalar paquetes en el entorno virtual # Instalar paquetes en el entorno virtual
sudo apt install -y libssl-dev apt-get install -y libssl-dev
python3 -m pip install pip setuptools
python3 -m pip install cryptography Twisted bitstring MarkupSafe bitarray configparser aprslib attrs wheel service_identity pyOpenSSL mysqlclient tinydb ansi2html mysql-connector-python pandas xlsxwriter cursor pynmea2 maidenhead flask folium mysql-connector resettabletimer setproctitle requests libscrc Pyro5
# Desactivar el entorno virtual
deactivate
#pip install cryptography pyopenssl autobahn Twisted bitstring MarkupSafe bitarray configparser aprslib attrs wheel service_identity pyOpenSSL mysqlclient tinydb ansi2html mysql-connector-python pandas xlsxwriter cursor pynmea2 maidenhead flask folium mysql-connector resettabletimer setproctitle requests libscrc Pyro5
cd /opt
# Instalar Rust y configurar versión # Instalar Rust y configurar versión
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env source $HOME/.cargo/env
@ -66,15 +68,13 @@ source $HOME/.cargo/env
rustup install 1.72.0 rustup install 1.72.0
rustup default 1.72.0 rustup default 1.72.0
python3 -m pip install --no-cache-dir --upgrade pip setuptools /usr/bin/python3 -m pip install --upgrade pyOpenSSL
python3 -m pip install --no-cache-dir --upgrade cryptography pyopenssl autobahn Twisted dmr_utils3 bitstring jinja2 MarkupSafe bitarray configparser aprslib attrs wheel service_identity pyOpenSSL mysqlclient tinydb ansi2html mysql-connector-python pandas xlsxwriter cursor pynmea2 maidenhead flask folium mysql-connector resettabletimer setproctitle requests libscrc Pyro5 /usr/bin/python3 -m pip install --upgrade autobahn
/usr/bin/python3 -m pip install --upgrade jinja2
# Desactivar el entorno virtual /usr/bin/python3 -m pip install --upgrade dmr-utils3
deactivate
pip install --no-cache-dir --upgrade cryptography pyopenssl autobahn Twisted dmr_utils3 bitstring jinja2 MarkupSafe bitarray configparser aprslib attrs wheel service_identity pyOpenSSL mysqlclient tinydb ansi2html mysql-connector-python pandas xlsxwriter cursor pynmea2 maidenhead flask folium mysql-connector resettabletimer setproctitle requests libscrc Pyro5
echo "Instalación completa." echo "Instalación completa."
####### #######
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/fdmr/-/raw/main/install.sh)" bash -c "$(curl -fsSL https://gitlab.com/hp3icc/fdmr/-/raw/main/install.sh)"
sudo systemctl start freedmr.service sudo systemctl start freedmr.service

Loading…
Cancel
Save

Powered by TurnKey Linux.