From e8c9c0ca7e6c307243c158fd529c59c5a3717f2f Mon Sep 17 00:00:00 2001
From: wuwei <wuquan-1230@q63.com>
Date: 星期五, 13 六月 2025 10:05:06 +0800
Subject: [PATCH] 1.同步最新的文件
---
local/script/set_net | 61 ++++++++++++++++++------------
1 files changed, 36 insertions(+), 25 deletions(-)
diff --git a/local/script/set_net b/local/script/set_net
index 947cc8f..e6a6dea 100755
--- a/local/script/set_net
+++ b/local/script/set_net
@@ -9,24 +9,33 @@
#***********************************************************
setMacAddr()
{
- mac=`$json -g $file eth0.mac`
- if [ $? -ne 0 ]
+ netNo=$1
+ mac=`$json -g $file eth$netNo\.mac`
+ ret=$?
+ if [ $ret -ne 0 ]
then
- return;
+ mac=`$json -g $file eth$netNo\.mac`
+ echo "ret: $?, mac$netNo: $mac"
fi
- /sbin/ifconfig eth0 down
- /sbin/ifconfig eth0 hw ether $mac
-# /sbin/ifconfig eth0 up
- echo "set mac0 $mac"
+
+ ifconfig eth$netNo down
+ ifconfig eth$netNo hw ether $mac
+ ifconfig eth$netNo up
+
+ echo set mac$netNo $mac
+
}
+
#********************************************************************
setMacAddr 0
+setMacAddr 1
-#由于丝印与实际网口是反的,所以这里需要反一下
#-set eth0----------------------------------
+ip=`$json -g $file "eth0.ip"`
+mask=`jsoner -g $file "eth0.mask"`
dhcp0=`$json -g $file "eth0.dhcp"`
if [ $? -eq 0 ]
then
@@ -34,32 +43,34 @@
if [ $dhcp0 == "on" ]
then
echo "dhcp1 is true"
- /sbin/udhcpc -i eth0 &
- exit
- fi
+ udhcpc -i eth0 &
+ else
+ ifconfig eth0 $ip netmask $mask up
+ fi
+else
+ ifconfig eth0 $ip netmask $mask up
+
fi
-
-sleep 1
-
-ip=`$json -g $file "eth0.ip"`
-mask=`jsoner -g $file "eth0.mask"`
-#/sbin/ifconfig eth0 down
-/sbin/ifconfig eth0 $ip netmask $mask up
gate=`$json -g $file "eth0.gate"`
route del default dev eth0
route add default gw $gate dev eth0
+#-set eth1----------------------------------
+ip=`$json -g $file "eth1.ip"`
+mask=`jsoner -g $file "eth1.mask"`
+#ifconfig eth1 down
+ifconfig eth1 $ip netmask $mask up
-VALID_WIFI=`$json -g $file "wifi.enable"`
-VALID_4G=`$json -g $file "4g.enable"`
+#VALID_WIFI=`$json -g $file "wifi.enable"`
+#VALID_4G=`$json -g $file "4g.enable"`
#设置wifi
-if [ ${VALID_WIFI} = "true" ]; then
- echo "start wifi..."
- /sbin/route del default
- $startWifi &
-fi
+#if [ ${VALID_WIFI} = "true" ]; then
+# echo "start wifi..."
+# /sbin/route del default
+# $startWifi &
+#fi
#设置4g
#if [ ${VALID_4G} = "true" ]
--
Gitblit v1.9.3