File: config

package info (click to toggle)
diald 0.99.4-7.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,100 kB
  • ctags: 935
  • sloc: ansic: 7,109; tcl: 977; sh: 880; perl: 306; makefile: 109
file content (47 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
#!/bin/sh -e

# Debconf
. /usr/share/debconf/confmodule

# Default IPs?
db_input medium diald/defaultip || true
db_go

db_get diald/defaultip
if [ "$RET" = "false" ]; then
    db_input medium diald/localip || true
    db_go

    db_input medium diald/remoteip || true
    db_go
fi

# Choose a provider
if [ `ls /etc/ppp/peers | wc -l` -gt 1 ]; then

    PPPLIST=`ls /etc/ppp/peers | perl -e 'while (<>) { chomp; push @list, $_; } print join(", ", @list);'`

    if [ -e /etc/diald/diald.options ]; then
	PPPLIST="old-config, $PPPLIST"
	PPPDEFAULT=old-config
    else
	PPPDEFAULT=provider
    fi

    if [ -f /etc/diald/diald.provider ]; then
	. /etc/diald/diald.provider
	PPPDEFAULT=$PROVIDER
    fi

    db_subst diald/provider choices $PPPLIST
    db_subst diald/provider default $PPPDEFAULT

    db_input medium diald/provider || true
    db_go
elif [ `ls /etc/ppp/peers | wc -l` -eq 1 ]; then
    db_set diald/provider `ls /etc/ppp/peers`
else
    db_set diald/provider provider
fi

db_stop