mirror of https://gitlab.com/hp3icc/emq-TE1.git
Update menu
This commit is contained in:
parent
8dab333d57
commit
fc4269fa5c
180
menu/menu
180
menu/menu
|
|
@ -1,12 +1,87 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
###menu
|
###menu
|
||||||
if [ "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then
|
if [ ! "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then
|
||||||
sudo tee /bin/menu <<- "EOFX1"
|
sudo cat > /bin/menu <<- "EOFX2"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [[ $EUID -ne 0 ]]; then
|
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
|
whiptail --title "sudo su" --msgbox "Se requieren privilegios de superusuario. Ejecute 'sudo su' antes de ingresar al menú." 0 50
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
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 17 \
|
||||||
|
1 " APRS " \
|
||||||
|
2 " MMDVMHost " \
|
||||||
|
3 " Dvswitch " \
|
||||||
|
4 " pYSFReflector3 " \
|
||||||
|
5 " NXDN2DMR " \
|
||||||
|
6 " YSF2DMR " \
|
||||||
|
7 " YSF2YSF " \
|
||||||
|
8 " HBLink3 Server " \
|
||||||
|
9 " FreeDMR Server " \
|
||||||
|
10 " DDNS NoIP " \
|
||||||
|
11 " GoTTY " \
|
||||||
|
12 " Firewall " \
|
||||||
|
13 " Update " \
|
||||||
|
14 " Reiniciar Equipo " \
|
||||||
|
15 " Set Time Zone " \
|
||||||
|
16 " Salir del menú " 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)
|
||||||
|
menu-aprs;;
|
||||||
|
2)
|
||||||
|
menu-mmdvm;;
|
||||||
|
3)
|
||||||
|
menu-dvs;;
|
||||||
|
4)
|
||||||
|
menu-ysf;;
|
||||||
|
5)
|
||||||
|
menu-nxdn2dmr;;
|
||||||
|
6)
|
||||||
|
menu-ysf2dmr;;
|
||||||
|
7)
|
||||||
|
menu-ysf2ysf;;
|
||||||
|
8)
|
||||||
|
menu-hbl;;
|
||||||
|
9)
|
||||||
|
menu-fdmr;;
|
||||||
|
10)
|
||||||
|
menu-noip ;;
|
||||||
|
11)
|
||||||
|
menu-web ;;
|
||||||
|
12)
|
||||||
|
menu-ufw ;;
|
||||||
|
13)
|
||||||
|
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
|
||||||
|
14)
|
||||||
|
menu-reboot ;;
|
||||||
|
15)
|
||||||
|
dpkg-reconfigure tzdata ;;
|
||||||
|
16)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
EOFX2
|
||||||
|
fi
|
||||||
|
if [ "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then
|
||||||
|
sudo cat > /bin/menu <<- "EOFX1"
|
||||||
|
#!/bin/bash
|
||||||
|
if [[ $EUID -ne 0 ]]; then
|
||||||
|
whiptail --title "sudo su" --msgbox "Se requieren privilegios de superusuario. Ejecute 'sudo su' antes de ingresar al menú." 0 50
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
while : ; do
|
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 17 \
|
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 17 \
|
||||||
1 " APRS " \
|
1 " APRS " \
|
||||||
|
|
@ -26,16 +101,16 @@ while : ; do
|
||||||
15 " Reiniciar Equipo " \
|
15 " Reiniciar Equipo " \
|
||||||
16 " Set Time Zone " \
|
16 " Set Time Zone " \
|
||||||
17 " Salir del menú " 3>&1 1>&2 2>&3)
|
17 " Salir del menú " 3>&1 1>&2 2>&3)
|
||||||
exitstatus=$?
|
exitstatus=$?
|
||||||
# Recuperar la opción seleccionada
|
|
||||||
# exitstatus=$?
|
if [ $exitstatus = 0 ]; then
|
||||||
if [ $exitstatus = 0 ]; then
|
echo "Your chosen option:" $choix
|
||||||
echo "La opción seleccionada:" $choix
|
else
|
||||||
else
|
echo "You chose cancel."
|
||||||
echo "Usted eligió cancelar."; break;
|
break
|
||||||
fi
|
fi
|
||||||
# Caso: acción en función de la opción seleccionada
|
|
||||||
case $choix in
|
case $choix in
|
||||||
1)
|
1)
|
||||||
menu-aprs;;
|
menu-aprs;;
|
||||||
2)
|
2)
|
||||||
|
|
@ -69,84 +144,13 @@ while : ; do
|
||||||
16)
|
16)
|
||||||
dpkg-reconfigure tzdata ;;
|
dpkg-reconfigure tzdata ;;
|
||||||
17)
|
17)
|
||||||
break;
|
break
|
||||||
esac
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
exit 0
|
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 al menú / requires root user, type (sudo su) before entering menu" 0 50
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
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 17 \
|
|
||||||
1 " APRS " \
|
|
||||||
2 " MMDVMHost " \
|
|
||||||
3 " Dvswitch " \
|
|
||||||
4 " pYSFReflector3 " \
|
|
||||||
5 " NXDN2DMR " \
|
|
||||||
6 " YSF2DMR " \
|
|
||||||
7 " YSF2YSF " \
|
|
||||||
8 " HBLink3 Server " \
|
|
||||||
9 " FreeDMR Server " \
|
|
||||||
10 " DDNS NoIP " \
|
|
||||||
11 " GoTTY " \
|
|
||||||
12 " Firewall " \
|
|
||||||
13 " Update " \
|
|
||||||
14 " Reiniciar Equipo " \
|
|
||||||
15 " Set Time Zone " \
|
|
||||||
16 " 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;
|
|
||||||
fi
|
|
||||||
# Caso: acción en función de la opción elegida
|
|
||||||
case \$choix in
|
|
||||||
1)
|
|
||||||
menu-aprs;;
|
|
||||||
2)
|
|
||||||
menu-mmdvm;;
|
|
||||||
3)
|
|
||||||
menu-dvs;;
|
|
||||||
4)
|
|
||||||
menu-ysf;;
|
|
||||||
5)
|
|
||||||
menu-nxdn2dmr;;
|
|
||||||
6)
|
|
||||||
menu-ysf2dmr;;
|
|
||||||
7)
|
|
||||||
menu-ysf2ysf;;
|
|
||||||
8)
|
|
||||||
menu-hbl;;
|
|
||||||
9)
|
|
||||||
menu-fdmr;;
|
|
||||||
10)
|
|
||||||
menu-noip ;;
|
|
||||||
11)
|
|
||||||
menu-web ;;
|
|
||||||
12)
|
|
||||||
menu-ufw ;;
|
|
||||||
13)
|
|
||||||
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
|
|
||||||
14)
|
|
||||||
menu-reboot ;;
|
|
||||||
15)
|
|
||||||
dpkg-reconfigure tzdata ;;
|
|
||||||
16)
|
|
||||||
break;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
exit 0
|
|
||||||
EOFX2
|
|
||||||
|
|
||||||
#
|
EOFX1
|
||||||
fi
|
fi
|
||||||
variable22=$(grep "EMQ-VER:" /opt/emq-ver | grep -Eo '[A.0-9]{1,9}')
|
variable22=$(grep "EMQ-VER:" /opt/emq-ver | grep -Eo '[A.0-9]{1,9}')
|
||||||
sudo sed -i "s/R00ab/$variable22/g" /bin/menu
|
sudo sed -i "s/R00ab/$variable22/g" /bin/menu
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue