Reply
Thread Tools
Posts: 5 | Thanked: 0 times | Joined on Mar 2010 @ Netherlands
#1
is there a way to connect to a predefined 3G modem APN from the commandline / terminal? I've got this desktop shortcut that creates a connection via ssh, but it doesn't automatically establishes internet connection. Also, AutoDisconnect is installed and active.
 
Posts: 5 | Thanked: 0 times | Joined on Mar 2010 @ Netherlands
#2
It seems that this script works:

Code:
dbus-send --type=method_call --system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:"Vodafone GPRS" uint32:0
 
Posts: 5 | Thanked: 0 times | Joined on Mar 2010 @ Netherlands
#3
I've got a simple bash script that connects to 3G, waits 10 seconds (so the connection is completed) and creates a SSH connection. I now want to extend it so that the first two commands (dbus script and wait 10s) only execute if the 3G connection isn't online. Otherwise, I always need to wait 10s before my SSH session launches..
 
Posts: 5 | Thanked: 0 times | Joined on Mar 2010 @ Netherlands
#4
So, this script checks for a gprs0 connection, and brings the APN online and loops until done before ssh'ing:
#/bin/bash
if
[ -d /sys/class/net/gprs0 ] && /sbin/ifconfig gprs0 | grep UP;
then
ssh irc;
else
dbus-send --type=method_call --system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:"Vodafone GPRS" uint32:0;
for i in $(seq 0 10);
do
if
/sbin/ifconfig gprs0 | grep UP;
then
i=10;
else
sleep 1;
fi;
done;
ssh irc;
fi;
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 20:59.