1
0
This repository has been archived on 2025-01-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Anderson Luiz Alves 0464e230c1 stock 103961
2017-07-30 16:48:04 -03:00

88 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
. /etc/bewan/scripts/globals
. /etc/bewan/lib/base
change_gvt_wanmode() {
local auto
local dsl
local eth
local phyint
local i
local j
local vid1
local vid2
local vid3
base_log "GVT Setting wan ethernet mode configuration" debug
> /tmp/gvt.cli
local WANETHMODE; eval WANETHMODE=$(cat /nvram/gvt/wanethmode 2>/dev/null)
[ -z "$WANETHMODE" ] && WANETHMODE='Default'
case "$WANETHMODE" in
'Port1')
vid1=2101
vid2=2201
vid3=2301
;;
'Port2')
vid1=2102
vid2=2202
vid3=2302
;;
'Port3')
vid1=2103
vid2=2203
vid3=2303
;;
'Port4')
vid1=2104
vid2=2204
vid3=2304
;;
'Port5')
vid1=2105
vid2=2205
vid3=2305
;;
# Everything else
*)
vid1=600
vid2=601
vid3=602
;;
esac
# This variable is set by the caller from factory.d
if [ -n "${INFACTORY:-}" ]; then
cat >> /tmp/gvt.cli <<EOF
cd _WANEthernetInterface_1_VLANInterface_1
sset VID $vid1
cd _WANEthernetInterface_1_VLANInterface_2
sset VID $vid2
cd _WANEthernetInterface_1_VLANInterface_3
sset VID $vid3
EOF
cli -q < /tmp/gvt.cli
rm -f /tmp/gvt.cli
else
cat >> /tmp/gvt.cli <<EOF
cd _WANEthernetInterface_1_VLANInterface_1
set VID $vid1
cd _WANEthernetInterface_1_VLANInterface_2
set VID $vid2
cd _WANEthernetInterface_1_VLANInterface_3
set VID $vid3
fcommit
EOF
(cli -s < /tmp/gvt.cli; rm -f /tmp/gvt.cli) &
fi
}
change_gvt_wanmode