File: config

package info (click to toggle)
wvdial 1.61-5
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 600 kB
  • sloc: cpp: 3,169; sh: 180; makefile: 158
file content (85 lines) | stat: -rwxr-xr-x 1,824 bytes parent folder | download | duplicates (4)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh

set -e

# Source debconf library
. /usr/share/debconf/confmodule

db_capb backup

# Update the Debconf database with information from /etc/wvdial.conf
if [ -e /etc/wvdial.conf ] && which uni >/dev/null 2>/dev/null; then
    export UNICONF='ini:/etc/wvdial.conf'
    update_db()
    {
    	set +e
	RET=`uni get "$1"`
	if [ $? ]; then
	    set -e
	    db_set "$2" "$RET"
	else
	    set -e
	fi
    }
else
    # We can't do anything
    update_db()
    {
	true
    }
fi

STATE=1
LASTSTATE=5
while [ "$STATE" != 0 ] && [ "$STATE" -le "$LASTSTATE" ]; do
    case "$STATE" in
	1)
	    db_input low wvdial/wvdialconf || true
            ;;
	2)
	    db_get wvdial/wvdialconf
	    if [ "$RET" = "true" ]; then
		update_db 'Dialer Defaults/Phone' wvdial/phone
		db_input medium wvdial/phone || true
	    fi
            ;;
	3)
	    db_get wvdial/wvdialconf
	    if [ "$RET" = "true" ]; then
		update_db 'Dialer Defaults/Username' wvdial/login
		db_input medium wvdial/login || true
	    fi
            ;;
	4)
	    db_get wvdial/wvdialconf
	    if [ "$RET" = "true" ]; then
		update_db 'Dialer Defaults/Password' wvdial/passphrase
		update_db 'Dialer Defaults/Password' wvdial/passphrase2
		db_input medium wvdial/passphrase || true
		db_input medium wvdial/passphrase2 || true
	    fi
            ;;
	5)
	    db_get wvdial/wvdialconf
	    if [ "$RET" = "true" ]; then
		db_get wvdial/passphrase
		PASSPHRASE="$RET"
		db_get wvdial/passphrase2
		if [ "$RET" != "$PASSPHRASE" ]; then
		    db_input medium wvdial/passphrases_mismatch || true
		    db_reset wvdial/passphrase
		    db_reset wvdial/passphrase2
		    db_fset wvdial/passphrase seen false
		    db_fset wvdial/passphrase2 seen false
		    STATE=3
		fi
	    fi
	    ;;
    esac

    if db_go; then
	STATE=$(($STATE + 1))
    else
	STATE=$(($STATE - 1))
    fi
done