Newer
Older
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
#!/bin/sh /etc/rc.common
# Copyright (C) 2012 OpenWrt.org
DebugLevel=3
BIN_DIR=@dsl_bin_dir@
# Default configuration for values that will be overwritten with external
# values defined within "dsl_auto.cfg.
xDSL_AutoCfg_Entities=1
start() {
[ -z "`cat /proc/modules | grep ifxos`" ] && {
echo "Ooops - IFXOS isn't loaded, DSL CPE API will do it. Check your basefiles..."
insmod /lib/modules/*/drv_ifxos.ko
}
if [ -r ${BIN_DIR}/dsl.cfg ]; then
. ${BIN_DIR}/dsl.cfg 2> /dev/null
fi
if [ "$xDSL_Dbg_DebugLevel" != "" ]; then
DebugLevel="${xDSL_Dbg_DebugLevel}"
else
if [ -e ${BIN_DIR}/debug_level.cfg ]; then
# read in the global definition of the debug level
. ${BIN_DIR}/debug_level.cfg 2> /dev/null
if [ "$ENABLE_DEBUG_OUTPUT" != "" ]; then
DebugLevel="${ENABLE_DEBUG_OUTPUT}"
fi
fi
fi
# Get environment variables for system related configuration
if [ -r ${BIN_DIR}/dsl_auto.cfg ]; then
. ${BIN_DIR}/dsl_auto.cfg 2> /dev/null
fi
# loading DSL CPE API driver -
cd ${BIN_DIR}
${BIN_DIR}/inst_drv_dsl_cpe_api.sh $DebugLevel
}
stop() {
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
if [ -r ${BIN_DIR}/dsl.cfg ]; then
. ${BIN_DIR}/dsl.cfg 2> /dev/null
fi
bDisableAllLines=1
# from SL via dsl_web.cfg
if [ "${xDSL_Cfg_EntitiesEnabledSet}" == "" ]; then
if [ -r /tmp/dsl_web.cfg ]; then
. /tmp/dsl_web.cfg 2> /dev/null
fi
# all lines will be operated
if [ "${EntitiesEnabled}" == "2" ]; then
bDisableAllLines=0
# one line will be operated
elif [ "${EntitiesEnabled}" == "1" ]; then
bDisableAllLines=0
# none lines will be operated
else
:
fi
# from dsl.cfg
else
# all lines will be operated
if [ "${xDSL_Cfg_EntitiesEnabledSet}" == "0" ] ||
([ "${xDSL_Cfg_EntitiesEnabledSet}" == "1" ] && [ "${xDSL_Cfg_EntitiesEnabledSelect}" == "2" ]); then
bDisableAllLines=0
# one line will be operated
elif [ "${xDSL_Cfg_EntitiesEnabledSet}" == "1" ] && [ "${xDSL_Cfg_EntitiesEnabledSelect}" == "1" ]; then
bDisableAllLines=0
# none lines will be operated
else
:
fi
fi
if [ ${bDisableAllLines} -eq 1 ]; then
rmmod drv_dsl_cpe_api
fi