From d0a9eaa4ba608cc3ea32cbacde8f39abe5200cd8 Mon Sep 17 00:00:00 2001 From: Esteban Mackay Q Date: Tue, 28 Nov 2023 12:00:58 -0500 Subject: [PATCH] Update asl-wizard.sh --- install/asl-wizard.sh | 52 ++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/install/asl-wizard.sh b/install/asl-wizard.sh index 630248d..0903e27 100644 --- a/install/asl-wizard.sh +++ b/install/asl-wizard.sh @@ -12,20 +12,32 @@ wget http://dvswitch.org/buster chmod +x buster ./buster fi -apt-get update && apt-get upgrade -y -if ! grep -q 'Raspberry' /proc/cpuinfo; then - if ! [ -d "/etc/asterisk" ]; then - apt-get install allstar -y - fi +if [ -f "/etc/os-release" ]; then + source /etc/os-release + + if [ "$VERSION_ID" == "10" ]; then + apt update -y + apt upgrade -y + else + apt-get update + apt-get upgrade -y + fi fi if [ ! -d "/etc/asterisk" ]; then - # Verificar si el sistema operativo es Debian 10 - if [ -f "/etc/os-release" ]; then - source /etc/os-release - if [ "$VERSION_ID" == "10" ]; then + source /etc/os-release + + if [ "$VERSION_ID" == "10" ]; then + # echo "Instalando AllStar en Debian 10" + apt install allstar -y + else + # Verificar si no es una Raspberry Pi + if ! grep -q 'Raspberry' /proc/cpuinfo; then + # echo "Instalando AllStar en sistema no identificado como Raspberry Pi" apt-get install allstar -y fi fi +else + echo "El directorio /etc/asterisk ya existe. No es necesario instalar AllStar." fi if [ -f "/lib/systemd/system/asterisk.service" ]; then systemctl stop asterisk @@ -42,11 +54,25 @@ wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download unzip /etc/asterisk/asl-wizard.zip -d /etc/asterisk/ fi # -if [ ! -f "/opt/MMDVM_Bridge/MMDVM_Bridge" ]; then - apt-get install MMDVM_Bridge -y -fi if [ ! -f "/opt/Analog_Bridge/Analog_Bridge" ]; then - apt-get install Analog_Bridge -y + # Verificar si el sistema operativo es Debian 10 + source /etc/os-release + + if [ "$VERSION_ID" == "10" ]; then + apt install Analog_Bridge -y + else + apt-get install Analog_Bridge -y + fi +fi +if [ ! -f "/opt/MMDVM_Bridge/MMDVM_Bridge" ]; then + # Verificar si el sistema operativo es Debian 10 + source /etc/os-release + + if [ "$VERSION_ID" == "10" ]; then + apt install MMDVM_Bridge -y + else + apt-get install MMDVM_Bridge -y + fi fi #USER99 # Lista de servicios a reiniciar