#!/bin/bash ############################################################################### # Establish a PPP connection using a Siemens ME45, IrDA and the Djuice Sweden # GPRS service. # # Currently set up to work with my Thinkpad T23. # # Per Weijnitz ############################################################################### USER="ornage" PASS="orange" IRCOMMDEV=/dev/ircomm0 ############################################################################### if ! ifconfig irda0 >/dev/null 2>/dev/null then echo "cannot find network interface irda0!" >&2 exit 1 fi echo "starting pppd..." cat << SCRIPTEOF > /tmp/chat_djuice ABORT NOCARRIER ABORT BUSY ABORT ERROR '' ATZ OK 'AT+CGDCONT=1,"IP","internet"' OK ATDT*99***1# SCRIPTEOF if ! pppd crtscts lock asyncmap 0 modem usepeerdns nodetach defaultroute user $USER password $PASS $IRCOMMDEV 115200 connect '/usr/sbin/chat -t 60 -f /tmp/chat_djuice' & then echo "pppd could not setup modem!" >&2 exit 1 fi PPPPID=$! echo "give it some time to boot..." sleep 10 echo "setting up routes..." route del default route add -net 10.10.10.0 netmask 255.255.255.0 dev ppp0 route add default gw 10.10.10.10 echo -n "press ENTER to shutdown... " read TMP kill $PPPPID