mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-31 03:03:10 +01:00
109 lines
2.4 KiB
Bash
Executable file
109 lines
2.4 KiB
Bash
Executable file
#!/bin/sh /etc/rc.common
|
|
|
|
. /lib/functions.sh
|
|
. /usr/share/libubox/jshn.sh
|
|
include /lib/network
|
|
|
|
START=21
|
|
USE_PROCD=1
|
|
|
|
start_service() {
|
|
local AnnexM
|
|
local GDmt
|
|
local Glite
|
|
local T1413
|
|
local ADSL2
|
|
local AnnexL
|
|
local ADSL2plus
|
|
local VDSL2
|
|
local a8a
|
|
local b8b
|
|
local c8c
|
|
local d8d
|
|
local a12a
|
|
local b12b
|
|
local a17a
|
|
local US0
|
|
local bitswap
|
|
local sra
|
|
local vdsl
|
|
|
|
config_load layer2_interface
|
|
config_get Glite capabilities Glite
|
|
config_get GDmt capabilities GDmt
|
|
config_get T1413 capabilities T1413
|
|
config_get ADSL2 capabilities ADSL2
|
|
config_get ADSL2plus capabilities ADSL2plus
|
|
config_get AnnexL capabilities AnnexL
|
|
config_get VDSL2 capabilities VDSL2
|
|
config_get AnnexM capabilities AnnexM
|
|
|
|
config_get a8a capabilities 8a
|
|
|
|
config_get b8b capabilities 8b
|
|
config_get c8c capabilities 8c
|
|
config_get d8d capabilities 8d
|
|
config_get a12a capabilities 12a
|
|
config_get b12b capabilities 12b
|
|
config_get a17a capabilities 17a
|
|
config_get US0 capabilities US0
|
|
config_get bitswap capabilities bitswap
|
|
config_get sra capabilities sra
|
|
GDmt=${GDmt/Enabled/d}
|
|
Glite=${Glite/Enabled/l}
|
|
T1413=${T1413/Enabled/t}
|
|
ADSL2=${ADSL2/Enabled/2}
|
|
AnnexL=${AnnexL/Enabled/e}
|
|
ADSL2plus=${ADSL2plus/Enabled/p}
|
|
AnnexM=${AnnexM/Enabled/m}
|
|
VDSL2=${VDSL2/Enabled/v}
|
|
|
|
a8a=${a8a/Enabled/8a}
|
|
b8b=${b8b/Enabled/8b}
|
|
c8c=${c8c/Enabled/8c}
|
|
c8c=${c8c/Enabled/8c}
|
|
|
|
d8d=${d8d/Enabled/8d}
|
|
|
|
a12a=${a12a/Enabled/12a}
|
|
b12b=${b12b/Enabled/12b}
|
|
a17a=${a17a/Enabled/17a}
|
|
|
|
echo "Starting DSL"
|
|
|
|
xtmctl start
|
|
xtmctl operate intf --state 1 enable
|
|
json_load "$(ubus call router quest "{ \"info\": \"specs\" }")"
|
|
json_get_var vdsl vdsl
|
|
|
|
if [ $vdsl -eq 1 ]; then
|
|
echo "xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM$VDSL2 --profile \"$a8a $b8b $c8c $d8d $a12a $b12b $a17a\" --sra $sra --bitswap $bitswap --us0 $US0"
|
|
xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM$VDSL2 --profile "$a8a $b8b $c8c $d8d $a12a $b12b $a17a" --sra $sra --bitswap $bitswap --us0 $US0
|
|
else
|
|
echo "xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM --sra $sra --bitswap $bitswap"
|
|
xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM --sra $sra --bitswap $bitswap
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
stop_service() {
|
|
echo "Stopping DSL"
|
|
xdslctl stop
|
|
}
|
|
|
|
boot() {
|
|
vlanctl --if-suffix .
|
|
add_ebtables_default_arp
|
|
start
|
|
}
|
|
|
|
reload_service() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger layer2_interface
|
|
}
|
|
|