From cf40e8f4934cdd81b05d71c98e0f541bfdb0b25f Mon Sep 17 00:00:00 2001 From: ZhuQI Date: Thu, 19 Sep 2019 11:05:26 +0800 Subject: [PATCH] Use lan0's mac address when eth0 does not exist. --- README.md | 2 ++ lora/rak2245/install.sh | 3 +++ lora/rak2247/install.sh | 3 +++ lora/rak7243/install.sh | 3 +++ rak/gateway-config | 3 +++ rak/rak/shell_script/rak_common.sh | 3 +++ 6 files changed, 17 insertions(+) diff --git a/README.md b/README.md index fc9c1b9..c1df565 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ This project currently provides support for the below platforms. * RAK7243 ## Changelog +2019-09-19 V4.0.0 +* Use lan0's mac address when eth0 does not exist. 2019-05-24 V2.9 diff --git a/lora/rak2245/install.sh b/lora/rak2245/install.sh index 9c1d27c..61f5f0c 100755 --- a/lora/rak2245/install.sh +++ b/lora/rak2245/install.sh @@ -21,6 +21,9 @@ GATEWAY_EUI_NIC="eth0" if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then GATEWAY_EUI_NIC="wlan0" fi +if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then + GATEWAY_EUI_NIC="usb0" +fi if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then echo "ERROR: No network interface found. Cannot set gateway ID." diff --git a/lora/rak2247/install.sh b/lora/rak2247/install.sh index 441a2e7..7449770 100755 --- a/lora/rak2247/install.sh +++ b/lora/rak2247/install.sh @@ -23,6 +23,9 @@ GATEWAY_EUI_NIC="eth0" if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then GATEWAY_EUI_NIC="wlan0" fi +if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then + GATEWAY_EUI_NIC="usb0" +fi if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then echo "ERROR: No network interface found. Cannot set gateway ID." diff --git a/lora/rak7243/install.sh b/lora/rak7243/install.sh index b1f9e8a..c403001 100755 --- a/lora/rak7243/install.sh +++ b/lora/rak7243/install.sh @@ -21,6 +21,9 @@ GATEWAY_EUI_NIC="eth0" if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then GATEWAY_EUI_NIC="wlan0" fi +if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then + GATEWAY_EUI_NIC="usb0" +fi if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then echo "ERROR: No network interface found. Cannot set gateway ID." diff --git a/rak/gateway-config b/rak/gateway-config index 485f9a8..39e04d3 100755 --- a/rak/gateway-config +++ b/rak/gateway-config @@ -956,6 +956,9 @@ do_get_gw_id() if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then GATEWAY_EUI_NIC="wlan0" fi + if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then + GATEWAY_EUI_NIC="usb0" + fi if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then echo "" diff --git a/rak/rak/shell_script/rak_common.sh b/rak/rak/shell_script/rak_common.sh index b304f00..e085271 100755 --- a/rak/rak/shell_script/rak_common.sh +++ b/rak/rak/shell_script/rak_common.sh @@ -52,6 +52,9 @@ do_get_gw_id() if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then GATEWAY_EUI_NIC="wlan0" fi + if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then + GATEWAY_EUI_NIC="usb0" + fi if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then echo ""