Bash script for common errors
#1
Hello, I´ve done a little script for common errors on UBports, specially useful for me on sound and modem. I hope you find it useful and improve it, I don´t know how to set the variable ip to the command ssh. I hope they solve soon this errors soon but in the meantime...


It´s on Spanish but:

1) WIFI RESET                          ...
2) ACTIVAR SIM                        Sim

3) ACTIVAR SONIDO                  Sound

4) ACTUALIZAR SISTEMA           System update





Code:
 #! / bin / sh

show_menus() {
   

    echo -e "********************************************** "

    echo -e "** $  1) WIFI RESET                         ** "

    echo -e "** $  2) ACTIVAR SIM                        ** "

    echo -e "** $  3) ACTIVAR SONIDO                     ** "

    echo -e "** $  4) ACTUALIZAR SISTEMA                 ** "

    echo -e "** $  5) SSH                                ** "

    echo -e "**********************************************  "

    echo -e "Ingrese una opción de menú y ingrese o ingrese para salir. "

    read opt


}

function option_picked () {


    echo -e

}


clear

show_menus

while : ;

    do

more

        case $opt in

        1) clear;

        option_picked "Opción 1 escogida";

sudo nmcli radio wifi off

sudo nmcli radio wifi on
     
sudo poweroff


show_menus;

        ;;


        2) clear;

            option_picked "Opción 2 escogida";

sudo /usr/share/ofono/scripts/enable-modem

sudo /usr/share/ofono/scripts/online-modem

        show_menus;

            ;;


        3) clear;

            option_picked "Opción 3 escogida";

modprobe snd_soc_simple_amplifier

modprobe snd_soc_simple_card_utils

amixer -c 0 set 'AIF1 Slot 0 Digital DAC' unmute

amixer sset 'Line Out' 100%;

            show_menus;

            ;;


        4) clear;

            option_picked "Opción 4 escogida";

sudo apt update && sudo apt upgrade;

           show_menus;

            ;;



        x) exit;

        ;;



        \ n) exit;

        ;;



        *)clear;

        Opción_pulsada "Elija una opción del menú";

        show_menus;

        ;;

    esac



done


Messages In This Thread
Bash script for common errors - by aleadom - 02-09-2020, 02:38 PM
RE: Bash script for common errors - by tcode - 02-12-2020, 06:23 AM
RE: Bash script for common errors - by undo - 02-13-2020, 08:11 AM
RE: Bash script for common errors - by Goddard - 02-13-2020, 02:25 PM
RE: Bash script for common errors - by dukla2000 - 02-14-2020, 04:58 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)