This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmeshapcfg.sh
executable file
·100 lines (79 loc) · 3.68 KB
/
meshapcfg.sh
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
######################################################################################
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
# Copyright 2018 RDK Management
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################
# This script is used to config the SSID.13, SSID.14 for mesh backhaul GRE
# by [email protected]
# prash: modified script for writing the mesh para after reading the current value
source /etc/device.properties
qca_cfg=0
if [ $MODEL_NUM == "DPC3941" ] || [ $MODEL_NUM == "TG1682G" ] || [ $MODEL_NUM == "DPC3939" ]; then
# RDKB-15951: Create a bridge for Mesh Bhaul and add vlan to it
echo "Creating Mesh Bhaul bridge"
brctl addbr br403
brctl addif br403 eth0.1060
ifconfig br403 up
qca_cfg=1
fi
for idx in 12 13
do
if [ "$idx" == "12" ]; then
brname="br12"
vlan=112
else
brname="br13"
vlan=113
fi
if [ -z `wifi_api wifi_getApEnable $idx` ] || [ `wifi_api wifi_getApEnable $idx` != "TRUE" ]; then
wifi_api wifi_setApEnable $idx 1
fi
uapsd=`wifi_api wifi_getApWmmUapsdEnable $idx | head -n 1`
if [[ -z $uapsd ]] || [[ "$uapsd" != "FALSE" ]]; then
wifi_api wifi_setApWmmUapsdEnable $idx 0
fi
#AP_BRNAME_13:=.
if [[ `wifi_api wifi_getApBridgeInfo $idx "" "" "" | head -n 1` != "$brname" ]]; then
wifi_api wifi_setApBridgeInfo $idx $brname "" ""
fi
wifi_api wifi_setApVlanID $idx $vlan
if [ -z `wifi_api wifi_getApSsidAdvertisementEnable $idx` ] || [ `wifi_api wifi_getApSsidAdvertisementEnable $idx` != "FALSE" ]; then
wifi_api wifi_setApSsidAdvertisementEnable $idx 0
fi
if [ -z `wifi_api wifi_getApBeaconType $idx` ] || [ `wifi_api wifi_getApBeaconType $idx` != "11i" ]; then
wifi_api wifi_setApBeaconType $idx "11i"
fi
#AP_SECFILE_13:=PSK
wifi_api wifi_setApBasicAuthenticationMode $idx "PSKAuthentication"
if [ -z `wifi_api wifi_getApWpaEncryptionMode $idx` ] || [ `wifi_api wifi_getApWpaEncryptionMode $idx` != "AESEncryption" ]; then
wifi_api wifi_setApWpaEncryptionMode $idx "AESEncryption"
fi
if [ $qca_cfg == 0 ]; then
wifi_api wifi_setSSIDName $idx "we.piranha.off"
else
cfg -a AP_SSID_$((idx+1))="we.piranha.off"
fi
#PSK_KEY_13:=welcome8
if [ $qca_cfg == 0 ]; then
if [[ -z `wifi_api wifi_getApSecurityPreSharedKey $idx` ]] || [[ `wifi_api wifi_getApSecurityPreSharedKey $idx` != "welcome8" ]]; then
wifi_api wifi_setApSecurityPreSharedKey $idx "welcome8"
fi
else
cfg -a PSK_KEY_$((idx+1))=welcome8
fi
if [ -z `wifi_api wifi_getApWpsEnable $idx` ] || [ `wifi_api wifi_getApWpsEnable $idx` != "FALSE" ]; then
wifi_api wifi_setApWpsEnable $idx 0
fi
if [ -z `wifi_api wifi_getApEnable $idx` ] || [ `wifi_api wifi_getApEnable $idx` != "TRUE" ]; then
wifi_api wifi_setApEnable $idx 1
fi
done