12
12
#
13
13
# mesh11sd daemon
14
14
#
15
- version=" 4.1.0beta "
15
+ version=" 4.1.0 "
16
16
fixup1=0
17
17
ip4pingfailcount=0
18
18
network_restart=0
@@ -1779,7 +1779,7 @@ auto_config() {
1779
1779
fi
1780
1780
else
1781
1781
debugtype=" err"
1782
- syslogmessage=" Unable to autoconfigure. Please install package wpad-mesh- mbedtls, wpad-mesh- wolfssl, wpad-mesh- openssl or an equivalent full version"
1782
+ syslogmessage=" Unable to autoconfigure. Please install package wpad-mbedtls, wpad-wolfssl, wpad-openssl or an equivalent mesh only version"
1783
1783
write_to_syslog
1784
1784
exit 1
1785
1785
fi
@@ -2234,6 +2234,10 @@ if [ -z "$1" ] || [ "$1" = "-h" ] || [ $1 = "--help" ] || [ $1 = "help" ]; then
2234
2234
Usage: mesh11sd opkg_revert_to_default
2235
2235
Reverts opkg to default for its downloads
2236
2236
2237
+ Option: dhcp4_renew
2238
+ Usage: mesh11sd dhcp4_renew
2239
+ Renews the current dhcp4 lease
2240
+
2237
2241
For further documentation, see: https://github.com/openNDS/mesh11sd#readme
2238
2242
2239
2243
"
@@ -2894,6 +2898,11 @@ elif [ "$1" = "opkg_revert_to_default" ]; then
2894
2898
2895
2899
exit 0
2896
2900
2901
+ elif [ " $1 " = " dhcp4_renew" ]; then
2902
+ dhcpdevice=$( echo " get network.$auto_mesh_network .device" | uci batch | awk ' {printf "%s", $1}' )
2903
+ dhcp4_renew
2904
+ exit 0
2905
+
2897
2906
elif [ " $1 " = " daemon" ]; then
2898
2907
debugtype=" notice"
2899
2908
syslogmessage=" mesh11sd is in startup"
@@ -2917,6 +2926,36 @@ elif [ "$1" = "daemon" ]; then
2917
2926
uci revert network
2918
2927
uci revert firewall
2919
2928
2929
+ # Check the configured ipv4 address and change it if left at default of 192.168.1.1
2930
+ # For now, only chack in CPE mode.
2931
+ # Possibly make this active for portal devices (via config option?)
2932
+ setipaddr=$( uci get network.lan.ipaddr)
2933
+
2934
+ if [ " $setipaddr " = " 192.168.1.1" ] && [ " $portal_detect " -eq 3 ]; then
2935
+ . $tmpdir /devicemac
2936
+
2937
+ for i in $( seq 9 1 64) ; do
2938
+ # choose start point of sequence away from end eg "9"
2939
+ cpipsubnet=$(( 0 x$(printf "$devicemac " | sha256 sum | awk '{printf $1 }' | tail - c$i | head - c2 )) )
2940
+
2941
+ # Check for max
2942
+ if [ $cpipsubnet -ge 255 ]; then
2943
+ continue
2944
+ fi
2945
+
2946
+ # Skip 168, 167, 0
2947
+ if [ $cpipsubnet -eq 168 ] || [ $cpipsubnet -eq 167 ] || [ $cpipsubnet -eq 0 ]; then
2948
+ continue
2949
+ fi
2950
+
2951
+ break
2952
+ done
2953
+
2954
+ newipaddr=" 192.168.$cpipsubnet .1"
2955
+ echo " set network.lan.ipaddr='$newipaddr '" | uci batch
2956
+ fi
2957
+
2958
+
2920
2959
# Before restarting the network, check if CPE mode is requested
2921
2960
if [ " $portal_detect " -eq 3 ]; then
2922
2961
# CPE mode, so setup network config accordingly
@@ -2935,32 +2974,6 @@ elif [ "$1" = "daemon" ]; then
2935
2974
uci set network.wan.device=' br-wan'
2936
2975
uci set network.wan6.device=' br-wan'
2937
2976
2938
- setipaddr=$( uci get network.lan.ipaddr)
2939
-
2940
- if [ " $setipaddr " = " 192.168.1.1" ]; then
2941
- . $tmpdir /devicemac
2942
-
2943
- for i in $( seq 9 1 64) ; do
2944
- # choose start point of sequence away from end eg "9"
2945
- cpipsubnet=$(( 0 x$(printf "$devicemac " | sha256 sum | awk '{printf $1 }' | tail - c$i | head - c2 )) )
2946
-
2947
- # Check for max
2948
- if [ $cpipsubnet -ge 255 ]; then
2949
- continue
2950
- fi
2951
-
2952
- # Skip 168, 167, 0
2953
- if [ $cpipsubnet -eq 168 ] || [ $cpipsubnet -eq 167 ] || [ $cpipsubnet -eq 0 ]; then
2954
- continue
2955
- fi
2956
-
2957
- break
2958
- done
2959
-
2960
- newipaddr=" 192.168.$cpipsubnet .1"
2961
- echo " set network.lan.ipaddr='$newipaddr '" | uci batch
2962
- fi
2963
-
2964
2977
# Refresh the ipaddr
2965
2978
setipaddr=$( uci get network.lan.ipaddr)
2966
2979
0 commit comments