[ubuntu-za] Howto use vodacom vodafone mobile modem K4305

Miles msdomdonner at gmail.com
Mon Jul 1 09:05:05 UTC 2013


sudo gedit /etc/init.d/mobile-broadband-connect
put in the following script change th 2 places where I have 8ta to your
3g provider , I had to also change in nm where it showed 8.ta to just
8ta and save and close



#!/bin/sh
# Mobile Broadband Startup Service script v0.1 alpha by The Fan Club -
April 2012
# acts as startup service script for nmcli to fire up Mobile Broadband
Connections
# NOTE: Use the name of the Mobile Connection in the Network Manager as
the 'id' 
# USAGE: start|stop|status
#
### BEGIN INIT INFO 
# Provides: mobile-broadband-connect 
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 3 4 5 
# Default-Stop: 0 1 6 
# Short-Description: Autoconnect 3G GSM
### END INIT INFO

NAME="mobile-broadband-connect"
DESC="Autoconnect 3G/4G GSM USB modem at startup"

test -x $DAEMON || exit 0

case "$1" in
	start)
	   echo "Starting Mobile Broadband Connection."

	   while true; do
 	      # testing...
	      LC_ALL=C nmcli -t -f TYPE,STATE dev | grep -q "^gsm:disconnected
$"
	      if [ $? -eq 0 ]; then
	         break
 	      else
	         # no GSM modem detected yet, sleeping for a second
	         sleep 1
 	      fi
	   done

	   # Once GSM modem detected, run the script
	   nmcli -t con up id 8ta
	;;
	stop)
	   echo "Stopping Mobile Broadband Connection."
	   nmcli -t con down id 8ta
	   nmcli -t nm wwan off 
	;;
	status)
	   # Check to see if the process is running with nmcli
       nmcli -p dev
	;;
	
	*)
	   echo "Mobile Broadband Startup Service"
	   echo $"Usage: $0 {start|stop|status}"
	   exit 1
esac
exit 0

sudo chmod +x /etc/init.d/mobile-broadband-connect

To update the startup services

sudo update-rc.d mobile-broadband-connect defaults

 The script is registered as a system startup service so you can start,
stop, or check the status of the script with :

sudo service mobile-broadband-connect start

sudo service mobile-broadband-connect stop
 on rebooting mine worked and hasnt given problems since.
Good luck
Miles





More information about the ubuntu-za mailing list