Skip to content

Instantly share code, notes, and snippets.

@LuchoLopez
Created February 27, 2013 03:23
Show Gist options
  • Save LuchoLopez/5044745 to your computer and use it in GitHub Desktop.
Save LuchoLopez/5044745 to your computer and use it in GitHub Desktop.
If you're using a USB modem like ZTE or Huaweii, this tiny script should setup the enviroment to get it working.
#!/bin/bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###########################################################
# Created by Luis Lopez <luislopez72@gmail.com>
###########################################################
function closeme
{
# $1 = Exit code
# $2 = Description
echo "$2"
exit $1
}
if [ $UID -ne 0 ]; then closeme "1" "[error] Debe ser el usuario root"; fi
modprobe -r usb_storage 2>/dev/null
if [ $? -ne 0 ] ; then closeme "1" "[error] Error al quitar 'usb_storage'. Tiene algun dispositivo USB conectado?"; fi
modprobe usbserial 2>/dev/null
if [ $? -ne 0 ]; then closeme "1" "[error] Problema al cargar el modulo 'usbserial'."; fi
killall modem-manager
echo "[info] Listo! intente conectarse ahora"
echo "[info] nota: verifique que esta habilitada 'Banda ancha movil' haciendo click derecho sobre el gestor de la red"
closeme "0" "[info] Parece que todo salio bien :)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment