diff --git a/install.sh b/install.sh index ed49aba..a44df95 100644 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ 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 + exit 1 fi # Detectar el sistema operativo y su versión diff --git a/install/asl-wizard.sh b/install/asl-wizard.sh index ffe294f..0f1b706 100644 --- a/install/asl-wizard.sh +++ b/install/asl-wizard.sh @@ -3,8 +3,8 @@ SCRIPT_NAME="asl-wizard.sh" # Registra el inicio en /opt/curl.txt echo "Inicio: $SCRIPT_NAME" >> /opt/curl.txt -if [ "$EUID" -ne 0 ]; then - echo "Este script debe ejecutarse como root." +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 # REPO DVS diff --git a/install/docker.sh b/install/docker.sh index 31c6cfe..1901ec4 100644 --- a/install/docker.sh +++ b/install/docker.sh @@ -1,7 +1,7 @@ #!/bin/sh -if [[ $EUID -ne 0 ]]; then - whiptail --title "Docker Install" --msgbox "Debe ejecutar este script como usuario ROOT" 0 50 - exit 0 +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 (crontab -l | grep -v "sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1") | crontab - #!/bin/bash diff --git a/install/p25.sh b/install/p25.sh index d920062..db2c3d4 100644 --- a/install/p25.sh +++ b/install/p25.sh @@ -5,8 +5,8 @@ SCRIPT_NAME="p25.sh" # Registra el inicio en /opt/curl.txt echo "Inicio: $SCRIPT_NAME" >> /opt/curl.txt # Verificar si el usuario tiene permisos de root -if [[ $EUID -ne 0 ]]; then - echo "Este script debe ejecutarse como usuario ROOT" +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 diff --git a/install/p25cross.sh b/install/p25cross.sh index ea33fb7..d48315c 100644 --- a/install/p25cross.sh +++ b/install/p25cross.sh @@ -3,8 +3,8 @@ SCRIPT_NAME="p25cross.sh" # Registra el inicio en /opt/curl.txt echo "Inicio: $SCRIPT_NAME" >> /opt/curl.txt -if [ "$EUID" -ne 0 ]; then - echo "Este script debe ejecutarse como root." +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 # REPO DVS diff --git a/install/xlxd.sh b/install/xlxd.sh index c6cae2f..d7376b2 100644 --- a/install/xlxd.sh +++ b/install/xlxd.sh @@ -7,7 +7,7 @@ echo "Inicio: $SCRIPT_NAME" >> /opt/curl.txt # Verificar si el usuario tiene permisos de root 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 + exit 1 fi WHO=$(whoami) if [ "$WHO" != "root" ] diff --git a/install/ysfreflector.sh b/install/ysfreflector.sh index 9ebc051..a21d7f4 100644 --- a/install/ysfreflector.sh +++ b/install/ysfreflector.sh @@ -7,7 +7,7 @@ echo "Inicio: $SCRIPT_NAME" >> /opt/curl.txt # Verificar si el usuario tiene permisos de root 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 + exit 1 fi # Lista de aplicaciones para verificar e instalar #apps=("wget" "git" "sudo" "python3-pip" "python3-distutils" "python3-twisted" "python3-bitarray" "python3-dev" "rrdtool" "openssl" "libssl-dev" "python3-websockets" "python3-psutil") diff --git a/menu/menu b/menu/menu index f1ccdbe..8516a9e 100644 --- a/menu/menu +++ b/menu/menu @@ -3,9 +3,9 @@ if [ ! "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then sudo cat > /bin/menu <<- "EOFX2" #!/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 +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 while : ; do choix=$(whiptail --title "Proyecto emq-TE1+ Rev: R00ab / Scrip Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el número de opción:" 22 75 13 \ @@ -129,9 +129,9 @@ if [ ! "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then if [ -d "/etc/asterisk" ]; then sudo cat > /bin/menu <<- "EOFX2" #!/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 +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 while : ; do choix=$(whiptail --title "Proyecto emq-TE1+ Rev: R00ab / Scrip Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el número de opción:" 22 75 13 \ @@ -258,9 +258,9 @@ 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 +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 while : ; do choix=$(whiptail --title "Proyecto emq-TE1+ Rev: R00ab / Scrip Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el número de opción:" 22 75 13 \ @@ -387,9 +387,9 @@ if [ "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then if [ -d "/etc/asterisk" ]; 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 +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 while : ; do choix=$(whiptail --title "Proyecto emq-TE1+ Rev: R00ab / Scrip Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el número de opción:" 22 75 13 \ diff --git a/menu/menu-asl b/menu/menu-asl index 4c336e8..a04fd25 100644 --- a/menu/menu-asl +++ b/menu/menu-asl @@ -1,9 +1,9 @@ #!/bin/bash cat > /bin/menu-asl <<- "EOF" #!/bin/bash -if [[ $EUID -ne 0 ]]; then - whiptail --title "root" --msgbox "Cambie a usuario root / Change to user root" 0 50 - exit 0 +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 if ! [ -d "/etc/asterisk" ]; then whiptail --title "Easy-ASL" --msgbox "AllStarLink not Found / AllStarLink no instalado" 0 50 @@ -44,9 +44,9 @@ EOF if [ -d "/etc/nginx" ]; then cat > /bin/menu-asl <<- "EOF" #!/bin/bash -if [[ $EUID -ne 0 ]]; then - whiptail --title "root" --msgbox "Cambie a usuario root / Change to user root" 0 50 - exit 0 +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 if ! [ -d "/etc/asterisk" ]; then whiptail --title "Easy-ASL" --msgbox "AllStarLink not Found / AllStarLink no instalado" 0 50 @@ -90,9 +90,9 @@ exit 0 EOF cat > /bin/menu-allmon3 <<- "EOFA" #!/bin/bash -if [[ $EUID -ne 0 ]]; then - whiptail --title "root" --msgbox "Cambie a usuario root / Change to user root" 0 50 - exit 0 +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 if ! [ -d "/etc/asterisk" ]; then whiptail --title "Easy-ASL" --msgbox "AllStarLink not Found / AllStarLink no instalado" 0 50 @@ -515,9 +515,9 @@ EOF fi cat > /bin/menu-asle <<- "EOF" #!/bin/bash -if [[ $EUID -ne 0 ]]; then - whiptail --title "root" --msgbox "Cambie a usuario root / Change to user root" 0 50 - exit 0 +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 if ! [ -d "/etc/asterisk" ]; then whiptail --title "Easy-ASL" --msgbox "AllStarLink not Found / AllStarLink no instalado" 0 50 @@ -889,9 +889,9 @@ EOF ############################################################# cat > /bin/menu-aslb <<- "EOF" #!/bin/bash -if [[ $EUID -ne 0 ]]; then - whiptail --title "root" --msgbox "Cambie a usuario root / Change to user root" 0 50 - exit 0 +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 if ! [ -d "/etc/asterisk" ]; then whiptail --title "Easy-ASL" --msgbox "AllStarLink not Found / AllStarLink no instalado" 0 50 diff --git a/menu/menu-fdmr-bridge b/menu/menu-fdmr-bridge index f6c2d99..72500be 100644 --- a/menu/menu-fdmr-bridge +++ b/menu/menu-fdmr-bridge @@ -16,9 +16,9 @@ EOFX fi sudo cat > /bin/menu-fdmr-b <<- "EOF" #!/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 +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 while : ; do choix=$(whiptail --title "Raspbian Proyect HP3ICC FreeDMR-Bridge" --menu "move up or down with the keyboard arrows and select your option by pressing enter:" 23 56 13 \ diff --git a/menu/menu-ysf2ysf b/menu/menu-ysf2ysf index afb2f3d..b5fad09 100644 --- a/menu/menu-ysf2ysf +++ b/menu/menu-ysf2ysf @@ -1,9 +1,9 @@ #!/bin/bash sudo cat > /bin/menu-ysf2ysf <<- "EOF" #!/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 +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 while : ; do