Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
# desc: configure your internet connection via ppp over a modem
4
 
5
switch($1) {
6
case go
7
	devs=`{ls -p '#t/'eia? >[2]/dev/null}
8
	if(~ $#devs 0) {
9
		echo 'No serial port found; this can''t happen.'	# because configip checks
10
		exit
11
	}
12
 
13
	# not going to use the mouse for PPP
14
	if(~ eia^$mouseport $devs)
15
		devs=`{echo $devs | sed 's/eia'^$mouseport^'//'}
16
 
17
	if(~ $#devs 0) {
18
		echo 'The only serial port you have is your mouse.'
19
		echo 'Cannot configure PPP.'
20
		exit
21
	}
22
 
23
	echo
24
	echo 'Please choose the serial port or modem to use to connect to your ISP.'
25
	echo
26
	for(i in $devs) {
27
		n=`{echo $i | sed 's/eia//'}
28
		n=`{hoc -e 1+$n}
29
		echo '	'^$i^'(Windows'' COM'^$n^')'
30
	}
31
	echo
32
	prompt 'Serial device' $devs
33
	pppdev=$rd
34
 
35
	echo
36
	echo 'Pick a baud rate for the PPP connection.'
37
	echo
38
	prompt -d 115200 'Baud rate'
39
	pppbaud=$rd
40
 
41
	echo
42
	echo 'You can specify your dialup phone number, username, and password,'
43
	echo 'or you can log in manually by typing the modem commands yourself.'
44
	echo
45
	prompt 'Dialing method' auto manual
46
	pppmethod=$rd
47
 
48
	switch($pppmethod){
49
	case auto
50
		prompt 'PPP phone number'; pppphone=$rd
51
		prompt 'PPP phone username'; pppuser=$rd
52
		prompt 'PPP phone password'; ppppasswd=$rd
53
	}
54
 
55
	export pppdev pppmethod pppphone ppppasswd pppuser pppbaud
56
	exec startppp go
57
 
58
case checkdone
59
	if(! ~ $#pppmethod 1 || ! test -f /dev/$pppdev){
60
		configppp=notdone
61
		export configppp
62
	}
63
}