summaryrefslogtreecommitdiffstats
path: root/usr.bin/chat/ppp-on
blob: d150cfbd39100c85b5d27e256a6f372abd755bb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

#
#	ppp-on
#
#	Set up a PPP link
#

LOCKDIR=/var/spool/lock
DEVICE=cuaa0

PHONE=4511234
USER=Pkarl
PASSWORD=password
OUR_IP_ADDR=137.175.6.3

if [ -f $LOCKDIR/LCK..$DEVICE ]
then
    echo "PPP device is locked"
    exit 1
fi

(
    stty 19200 -tostop

    if chat -l LCK..$DEVICE ABORT "NO CARRIER" ABORT BUSY "" ATZ OK ATs50=255s111=0DT$PHONE CONNECT "" ogin: $USER ssword: \\q$PASSWORD
    then
	ppp mru 1500 $OUR_IP_ADDR: /dev/$DEVICE &
	sleep 10
	exit 0
    else
	echo "PPP call failed" 1>&2
	exit 1
    fi
) < /dev/$DEVICE > /dev/$DEVICE
OpenPOWER on IntegriCloud