diff --git a/install/allmon3.sh b/install/allmon3.sh index 1c65a18..aef57e8 100644 --- a/install/allmon3.sh +++ b/install/allmon3.sh @@ -6,13 +6,6 @@ if systemctl is-active "apache2" >/dev/null 2>&1; then fi if [ ! -d "/etc/allmon3" ]; then samllm3=1 - source /etc/os-release - - if [ "$VERSION_ID" == "11" ]; then - if ! grep -q 'Raspberry' /proc/cpuinfo; then -#Install on Debian 11 / Raspian 11 Software - - # Enable the Debian 11 bullseye-backports package repositorty: gpg --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 gpg --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 @@ -32,49 +25,6 @@ wget https://github.com/AllStarLink/Allmon3/releases/download/rel_t_1_0_2/allmon dpkg -i allmon3_1.0.2-1_all.deb else samllm3=0 - fi - fi -fi -if [ ! -d "/etc/allmon3" ]; then - samllm3=1 - source /etc/os-release - - if [ "$VERSION_ID" == "10" ]; then -#Install Debian 10 / Raspian 10 Software - -# Enable the Debian 10 buster-backports package repository: - -gpg --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC -gpg --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 -gpg --export 04EE7237B7D453EC | sudo apt-key add - -gpg --export 648ACFD622F3D138 | sudo apt-key add - -echo "deb https://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/buster-backports.list -apt update -y - -# Install the dependendencies - -apt install -y apache2 python3-argon2 -apt install -y -t buster-backports python3-async-timeout python3-attr python3-multidict python3-yarl - -# Install Python modules using PIP3 - -apt remove python3-aiohttp python3-websockets -pip3 install aiohttp -pip3 install aiohttp_session -pip3 install websockets - -# Update the CA Certificate chain since Debian 10 is out of support - -apt install ca-certificates -update-ca-certificates --fresh - -# Install Allmon3 (debian10 version) - -wget https://github.com/AllStarLink/Allmon3/releases/download/rel_t_1_0_2/allmon3_1.0.2-1_all.deb -dpkg -i allmon3_1.0.1-2_all.deb - else - samllm3=0 - fi fi if [ -d "/etc/allmon3" ]; then cat > "/etc/allmon3/allmon3.ini" <<- "EOFX" diff --git a/install/app.sh b/install/app.sh new file mode 100644 index 0000000..be85155 --- /dev/null +++ b/install/app.sh @@ -0,0 +1,58 @@ +#!/bin/bash +apps=("sudo" "curl" "git" "make" "build-essential" "libusb-1.0-0-dev" "python" "python3" "python3-full" "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" "gcc" "g++" "cmake" "libasound2-dev" "libudev-dev" "libsamplerate0-dev") + +# Función para verificar e instalar una aplicación +check_and_install() { + app=$1 + if ! dpkg -s $app 2>/dev/null | grep -q "Status: install ok installed"; then + echo "$app no está instalado. Instalando..." + sudo apt-get install -y $app + echo "$app instalado correctamente." + else + echo "$app ya está instalado." + fi +} + +# Verificar e instalar cada aplicación +for app in "${apps[@]}"; do + check_and_install $app +done + +if ! dpkg -s python3-venv >/dev/null 2>&1; then + echo "python3-venv no está instalado. Instalando..." + apt-get install python3-venv -y + echo "python3-venv instalado correctamente." +fi + +# Crear y activar un entorno virtual +cd /opt/ +python3 -m venv myenv +source myenv/bin/activate + +# 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 +python3 get-pip.py +rm get-pip.* + +# Instalar paquetes en el entorno virtual +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 +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +source $HOME/.cargo/env + +rustup install 1.72.0 +rustup default 1.72.0