File: config

package info (click to toggle)
smstools 3.1.21-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,500 kB
  • sloc: ansic: 18,624; sh: 1,196; php: 115; makefile: 42; awk: 17
file content (121 lines) | stat: -rw-r--r-- 2,781 bytes parent folder | download | duplicates (6)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/sh
set -e

if [ -f /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
fi

db_version 2.0

db_capb backup

STATE=1
MAXSTATE=12

devicecount=0

db_input medium smstools/configure || true
db_go || true

db_get smstools/configure
if [ "$RET" = 'true' ]; then
	if [ -f /etc/smsd.conf ]; then
		EVENTHANDLER="`grep '^eventhandler' /etc/smsd.conf|head -1|cut -d'=' -f2|sed 's/ //g'|sed 's/@EVENTHANDLER@//g'`"
		db_set smstools/eventhandler "$EVENTHANDLER" || true
		db_go
	fi



while [ "$STATE" != 0 -a "$STATE" -lt $MAXSTATE ]; do
	case "$STATE" in
	1)
		# Global event handler
		db_input medium smstools/eventhandler || true
	;;

	2)
		devicecount=$(( $devicecount+1 ))
		db_register smstools/devicename smstools/modems/devicename$devicecount || true

		if [ $devicecount -gt 1 ]
		then
			db_set smstools/modems/devicename$devicecount GSM$devicecount || true
		fi

		db_input medium smstools/modems/devicename$devicecount || true
	;;

	3)
		db_register smstools/devicenode smstools/modems/devicenode$devicecount || true
		db_input medium smstools/modems/devicenode$devicecount || true
	;;

	4)
		db_get smstools/modems/devicenode$devicecount || true

		if [ "$RET" = 'Other' ]; then
			db_register smstools/devicenodeother smstools/modems/devicenodeother$devicecount || true
			db_input medium smstools/modems/devicenodeother$devicecount || true
		fi

	;;

	5)
		db_register smstools/deviceinit smstools/modems/deviceinit$devicecount || true
		db_input low smstools/modems/deviceinit$devicecount || true
	;;

	6)
		db_register smstools/devicebaudrate smstools/modems/devicebaudrate$devicecount || true
		db_input low smstools/modems/devicebaudrate$devicecount || true
	;;

	7)
		db_get smstools/modems/devicebaudrate$devicecount || true

		if [ "$RET" = 'Other' ]; then
			db_register smstools/devicebaudrateother smstools/modems/devicebaudrateother$devicecount || true
			db_input low smstools/modems/devicebaudrateother$devicecount || true
		fi

	;;

	8)
		db_register smstools/deviceincoming smstools/modems/deviceincoming$devicecount || true
		db_input medium smstools/modems/deviceincoming$devicecount || true
	;;

	9)
		db_register smstools/devicepin smstools/modems/devicepin$devicecount || true
		db_input medium smstools/modems/devicepin$devicecount || true

	;;

	10)
		if [ $devicecount -le 32 ]; then
			db_register smstools/configureanothermodem smstools/configureanothermodem$devicecount || true
			db_input medium smstools/configureanothermodem$devicecount || true
		fi
	;;

	11)
		if [ $devicecount -le 32 ]; then
			db_get smstools/configureanothermodem$devicecount || true

			if [ "$RET" = 'true' ]; then
				STATE=1
			fi
		fi
	;;


	esac

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