File: pon

package info (click to toggle)
base-config 2.53.10.3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,072 kB
  • ctags: 36
  • sloc: sh: 1,755; makefile: 101; perl: 48
file content (39 lines) | stat: -rwxr-xr-x 1,243 bytes parent folder | download
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
36
37
38
39
#!/bin/sh
# Set up and enable ppp so that it can use used to download packages.
set -e
. /usr/share/debconf/confmodule

db_capb backup

# Should ppp be used?
db_input high base-config/use-ppp || true
if ! db_go; then
	db_fset base-config/use-ppp seen false
	exit 30 # to main menu
fi
db_fset base-config/use-ppp seen false
db_get base-config/use-ppp
if [ "$RET" = true ]; then
	# Set up ppp if not already set up.
	# /usr/share/ppp/provider.peer is the new location, but
	# /usr/share/doc/ppp/examples/provider.peer is used by the
	# version in testing at the time this is written.
	RECONFIGPPP=0
	if [ ! -e /etc/ppp/peers/provider ]; then
		RECONFIGPPP=1
	elif [ -e /usr/share/ppp/provider.peer ] &&
	     cmp -s /etc/ppp/peers/provider /usr/share/ppp/provider.peer; then
	     	RECONFIGPPP=1
	elif [ -e /usr/share/doc/ppp/examples/provider.peer ] &&
	     cmp -s /etc/ppp/peers/provider /usr/share/doc/ppp/examples/provider.peer; then
		RECONFIGPPP=1
	fi
	if [ "$RECONFIGPPP" = 1 ]; then
		pppconfig --noname </dev/tty >/dev/tty || true
	fi
	# redirect 3 so it goes to background w/o
	# hanging debconf later..
	pon </dev/tty >/dev/tty 2>/dev/tty 3>/dev/tty || true
	# TODO: this should be much more robust. What if ppp
	# fails to dial?
fi