File tree 5 files changed +16
-19
lines changed
conf/rak_rak7267/files/etc 5 files changed +16
-19
lines changed Original file line number Diff line number Diff line change
1
+ [ "$ACTION" == "add" ] || exit 0
2
+ [ "$DEVTYPE" == "wlan" ] || exit 0
3
+
4
+ . /lib/functions.sh
5
+ . /lib/functions/system.sh
6
+
7
+ uci set wireless.@wifi-iface[0].macaddr=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1)
8
+ uci commit wireless
9
+ wifi reload
10
+
Original file line number Diff line number Diff line change @@ -6,14 +6,10 @@ if [ "$(uci -q get wireless.default_radio0.ssid)" != "OpenWrt" ]; then
6
6
exit 0
7
7
fi
8
8
9
- GWID_END=""
9
+ . /lib/functions.sh
10
+ . /lib/functions/system.sh
10
11
11
- ip link show eth0
12
- if [ $? -eq 0 ]; then
13
- GWID_END=$(ip link show eth0 | awk '/ether/ {print $2}' | awk -F\: '{print $4$5$6}')
14
- else
15
- GWID_END=$(ip link show wlan0 | awk '/ether/ {print $2}' | awk -F\: '{print $4$5$6}')
16
- fi
12
+ GWID_END=$(mtd_get_mac_binary factory 0x4 | awk -F\: '{print $4$5$6}')
17
13
18
14
uci -q batch << EOI
19
15
set dhcp.wwan=dhcp
@@ -44,5 +40,3 @@ set firewall.@zone[0].masq='1'
44
40
commit firewall
45
41
46
42
EOI
47
-
48
- service network restart
Original file line number Diff line number Diff line change @@ -4,5 +4,3 @@ delete network.lan.ipaddr
4
4
delete network.lan.netmask
5
5
delete network.lan.ip6assign
6
6
EOI
7
-
8
- service network restart
Original file line number Diff line number Diff line change @@ -13,4 +13,3 @@ add_list system.led_eth_led.mode='tx'
13
13
add_list system.led_eth_led.mode='rx'
14
14
EOI
15
15
uci commit system
16
- service led restart
Original file line number Diff line number Diff line change 1
- GWID_END=""
1
+ . /lib/functions.sh
2
+ . /lib/functions/system.sh
2
3
3
- ip link show eth0
4
- if [ $? -eq 0 ]; then
5
- GWID_END=$(ip link show eth0 | awk '/ether/ {print $2}' | awk -F\: '{print $4$5$6}')
6
- else
7
- GWID_END=$(ip link show wlan0 | awk '/ether/ {print $2}' | awk -F\: '{print $4$5$6}')
8
- fi
4
+ GWID_END=$(mtd_get_mac_binary factory 0x4 | awk -F\: '{print $4$5$6}')
9
5
10
6
uci set system.@system[0].hostname="chirpstack-${GWID_END}"
11
7
uci commit system
You can’t perform that action at this time.
0 commit comments