Update menu

This commit is contained in:
Esteban Mackay Q 2023-09-08 22:55:30 -05:00
parent d90cdf8691
commit a4ca515ec4
1 changed files with 72 additions and 73 deletions

145
menu/menu
View File

@ -1,15 +1,15 @@
#!/bin/bash
###menu
if [ "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then
sudo cat > /bin/menu <<- "EOF"
sudo tee /bin/menu <<- "EOFX1"
#!/bin/bash
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 0
fi
if [[ $EUID -ne 0 ]]; then
whiptail --title "sudo su" --msgbox "Se requieren permisos de usuario root, escriba (sudo su) antes de ingresar al menú / Root user permissions required, type (sudo su) before entering the menu" 0 50
exit 0
fi
while : ; do
choix=$(whiptail --title "Proyect emq-TE1+ Rev: R00ab / Raspbian Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion:" 24 70 16 \
while : ; do
choix=$(whiptail --title "Proyecto emq-TE1+ Rev: R00ab / Proyecto Raspbian por HP3ICC 73." --menu "Use las flechas del teclado para subir o bajar y seleccione el número de opción:" 24 70 16 \
1 " APRS " \
2 " MMDVMHost " \
3 " Dvswitch " \
@ -17,72 +17,71 @@ sudo cat > /bin/menu <<- "EOF"
5 " NXDN2DMR " \
6 " YSF2DMR " \
7 " YSF2YSF " \
8 " HBLink3 Server " \
9 " FreeDMR Server " \
10 " WiFi Mannager " \
8 " Servidor HBLink3 " \
9 " Servidor FreeDMR " \
10 " WiFi Tools " \
11 " DDNS NoIP " \
12 " GoTTY " \
13 " Firewall " \
14 " Update " \
14 " Actualización " \
15 " Reiniciar Equipo " \
16 " Salir del menu " 3>&1 1>&2 2>&3)
16 " Salir del menú " 3>&1 1>&2 2>&3)
exitstatus=$?
#on recupere ce choix
#exitstatus=$?
# Recuperar la opción seleccionada
# exitstatus=$?
if [ $exitstatus = 0 ]; then
echo "Your chosen option:" $choix
else
echo "You chose cancel."; break;
echo "La opción seleccionada:" $choix
else
echo "Usted eligió cancelar."; break;
fi
# case : action en fonction du choix
# Caso: acción en función de la opción seleccionada
case $choix in
1)
menu-aprs;;
menu-aprs;;
2)
menu-mmdvm;;
menu-mmdvm;;
3)
menu-dvs;;
menu-dvs;;
4)
menu-ysf;;
menu-ysf;;
5)
menu-nxdn2dmr;;
menu-nxdn2dmr;;
6)
menu-ysf2dmr;;
menu-ysf2dmr;;
7)
menu-ysf2ysf;;
menu-ysf2ysf;;
8)
menu-hbl;;
menu-hbl;;
9)
menu-fdmr;;
menu-fdmr;;
10)
menu-wifi-mannager;;
menu-wifi-manager;;
11)
menu-noip ;;
menu-noip ;;
12)
menu-web ;;
menu-gotty ;;
13)
menu-ufw ;;
menu-firewall ;;
14)
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
15)
menu-reboot ;;
menu-reboot ;;
16)
break;
break;
esac
done
exit 0
EOF
else
sudo cat > /bin/menu <<- "EOF"
done
exit 0
EOFX1
else
sudo tee /bin/menu <<EOFX2
#!/bin/bash
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 0
fi
if [[ \$EUID -ne 0 ]]; then
whiptail --title "sudo su" --msgbox "requiere ser usuario root, escriba (sudo su) antes de entrar al menú / requires root user, type (sudo su) before entering menu" 0 50
exit 0
fi
while : ; do
choix=$(whiptail --title "Proyect emq-TE1+ Rev: R00ab / Raspbian Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion:" 24 70 16 \
while : ; do
choix=\$(whiptail --title "Proyecto emq-TE1+ Rev: R00ab / Raspbian Proyecto por HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el número de opción:" 24 70 16 \
1 " APRS " \
2 " MMDVMHost " \
3 " Dvswitch " \
@ -97,52 +96,52 @@ else
12 " Firewall " \
13 " Update " \
14 " Reiniciar Equipo " \
15 " Salir del menu " 3>&1 1>&2 2>&3)
exitstatus=$?
#on recupere ce choix
#exitstatus=$?
if [ $exitstatus = 0 ]; then
echo "Your chosen option:" $choix
15 " Salir del menú " 3>&1 1>&2 2>&3)
exitstatus=\$?
# Recuperamos la opción elegida
# exitstatus=\$?
if [ \$exitstatus = 0 ]; then
echo "Your chosen option:" \$choix
else
echo "You chose cancel."; break;
echo "You chose cancel."; break;
fi
# case : action en fonction du choix
case $choix in
# Caso: acción en función de la opción elegida
case \$choix in
1)
menu-aprs;;
menu-aprs;;
2)
menu-mmdvm;;
menu-mmdvm;;
3)
menu-dvs;;
menu-dvs;;
4)
menu-ysf;;
menu-ysf;;
5)
menu-nxdn2dmr;;
menu-nxdn2dmr;;
6)
menu-ysf2dmr;;
menu-ysf2dmr;;
7)
menu-ysf2ysf;;
menu-ysf2ysf;;
8)
menu-hbl;;
menu-hbl;;
9)
menu-fdmr;;
menu-fdmr;;
10)
menu-noip ;;
menu-noip ;;
11)
menu-web ;;
menu-web ;;
12)
menu-ufw ;;
menu-ufw ;;
13)
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
bash -c "\$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
14)
menu-reboot ;;
menu-reboot ;;
15)
break;
break;
esac
done
exit 0
done
exit 0
EOFX2
EOF
#
fi
variable22=$(grep "EMQ-VER:" /opt/emq-ver | grep -Eo '[A.0-9]{1,9}')