This commit is contained in:
Esteban Mackay Q. 2025-02-02 22:21:30 -05:00
parent 7f8eede056
commit f0770419bd
3 changed files with 20 additions and 40 deletions

View File

@ -4,7 +4,10 @@ if [ $EUID -ne 0 ]; then
whiptail --title "sudo su" --msgbox "requiere ser usuario root , escriba (sudo su) antes de entrar a menu / requires root user, type (sudo su) before entering menu" 0 50
exit 1
fi
# Crear archivo de versión
cat > /opt/emq-ver <<- "EOF"
EMQ-VER: 25.02.02
EOF
# Actualizar la lista de paquetes una vez al principio
apt-get update
@ -195,34 +198,11 @@ sudo systemctl enable gotty.service
# Ajustar configuración de Jitter
find /opt/ -type f -exec sed -i "s|Jitter=.*|Jitter=240|g" {} +
# Crear script de finalización
cat > /tmp/completado.sh <<- "EOF"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Esteban Mackay 73." --menu " Precione enter (return o intro) para finalizar la instalacion y reiniciar" 11 85 3 \
1 " Iniciar Reinicio de equipo " 3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
echo "Your chosen option:" $choix
else
echo "You chose cancel."; break;
fi
case $choix in
1)
sudo reboot
;;
esac
done
exit 0
EOF
# Crear archivo de versión
cat > /opt/emq-ver <<- "EOF"
EMQ-VER: 25.01.29
EOF
# Ejecutar menú principal
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu)"
sudo chmod +x /tmp/completado.sh
# Crear script de finalización
variable22=$(grep "EMQ-VER:" /opt/emq-ver | grep -Eo '[A.0-9]{1,9}')
whiptail --title "emq-TE1+ Rev: $variable22" --msgbox "Instalacion finalizada / Installation completed:\n\n\
El equipo requiere reinicia, ingrece nuevamente y escriba menu\n\
The computer requires a restart, enter again and type menu" 0 50
history -c && history -w
sh /tmp/completado.sh
sudo reboot

View File

@ -16,8 +16,8 @@ mv /var/www/html/* /var/www/dvs/ &&
#sed -i "s/'UTC'/'Africa\/Lagos'/" /var/www/dvs/include/*.php
sed -i "s/www\/html/www\/dvs/g" /var/www/dvs/include/* &&
#sed -i "s/usrp.duckdns.org\/user.csv/datafiles.ddns.net:8888\/user.csv/g" /var/www/dvs/include/* &&
#sed -i "s/Dashboard based on Pi-Star Dashboard, © Andy Taylor.*/Dashboard based on Pi-Star Dashboard, © Andy Taylor (MW0MWZ) and adapted to DVSwitch by SP2ONG<br> <a title=\"Raspbian Proyect by HP3ICC © <?php \$cdate=date(\"Y\"); if (\$cdate > \"2018\") {\$cdate=\"2018-\".date(\"Y\");} echo \$cdate; ?>\" target=\"_blank\" href=https:\/\/gitlab.com\/hp3icc\/emq-TE1\/>Script project: emq-TE1ws+<\/a><\/span><\/center>/" /var/www/dvs/index.php &&
#sed -i "s/<meta name=\"Description\".*/<meta name=\"Description\" content=\"Dashboard based on Pi-Star Dashboard, © Andy Taylor (MW0MWZ) and adapted to DVSwitch by SP2ONG\" \/>/" /var/www/dvs/index.php &&
sed -i "s/Dashboard based on Pi-Star Dashboard, © Andy Taylor.*/Dashboard based on Pi-Star Dashboard, © Andy Taylor (MW0MWZ) and adapted to DVSwitch by SP2ONG<br> <a title=\"Script Proyect by HP3ICC © <?php \$cdate=date(\"Y\"); if (\$cdate > \"2018\") {\$cdate=\"2018-\".date(\"Y\");} echo \$cdate; ?>\" target=\"_blank\" href=https:\/\/gitlab.com\/hp3icc\/emq-TE1\/>Script project: emq-TE1+<\/a><\/span><\/center>/" /var/www/dvs/index.php &&
sed -i "s/<meta name=\"Description\".*/<meta name=\"Description\" content=\"Dashboard based on Pi-Star Dashboard, © Andy Taylor (MW0MWZ) and adapted to DVSwitch by SP2ONG\" \/>/" /var/www/dvs/index.php &&
sed -i "s/www\/html/www\/dvs/g" /usr/local/sbin/update-config.sh
sed -i "s/www\/html/www\/dvs/g" /var/lib/dpkg/info/dvswitch*
#####

View File

@ -12,11 +12,11 @@ Web-Dashboar-dir: /var/www/dvs
EOFX
fi
if [ ! -d "/var/www/dvs/qrz_photo/" ] && [ ! -f "/usr/local/dvs/dvsmu" ]; then
if [ ! -d "/var/www/dvs/qrz_photo/" ] && [ ! -f "/usr/local/dvs/dvsmu" ] && [ -f "/opt/emq-ver" ]; then
sudo cat > /bin/menu-dvs <<- "EOF3"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
choix=$(whiptail --title "Script Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
1 " Encender Dvswitch " \
2 " Apagar Dvswitch " \
3 " Editar Dvswitch Server " \
@ -251,11 +251,11 @@ exit 0
EOF3
fi
#
if [ ! -d "/var/www/dvs/qrz_photo/" ] && [ -f "/usr/local/dvs/dvsmu" ]; then
if [ ! -d "/var/www/dvs/qrz_photo/" ] && [ -f "/usr/local/dvs/dvsmu" ] && [ -f "/opt/emq-ver" ]; then
sudo cat > /bin/menu-dvs <<- "EOFR"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
choix=$(whiptail --title "Script Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
1 " Encender Dvswitch " \
2 " Apagar Dvswitch " \
3 " Editar Dvswitch Server " \
@ -473,11 +473,11 @@ exit 0
EOFR
fi
if [ -d "/var/www/dvs/qrz_photo/" ] && [ ! -f "/usr/local/dvs/dvsmu" ]; then
if [ -d "/var/www/dvs/qrz_photo/" ] && [ ! -f "/usr/local/dvs/dvsmu" ] && [ -f "/opt/emq-ver" ]; then
sudo cat > /bin/menu-dvs <<- "EOF3"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
choix=$(whiptail --title "Script Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
1 " Encender Dvswitch " \
2 " Apagar Dvswitch " \
3 " Editar Dvswitch Server " \
@ -776,12 +776,12 @@ done
exit 0
EOF3
fi
if [ -d "/var/www/dvs/qrz_photo/" ] && [ -f "/usr/local/dvs/dvsmu" ]; then
if [ -d "/var/www/dvs/qrz_photo/" ] && [ -f "/usr/local/dvs/dvsmu" ] && [ -f "/opt/emq-ver" ]; then
# Avanzar con el script si el directorio y el archivo existen
sudo cat > /bin/menu-dvs <<- "EOFR"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
choix=$(whiptail --title "Script Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \
1 " Encender Dvswitch " \
2 " Apagar Dvswitch " \
3 " Editar Dvswitch Server " \