wuwei
2025-06-16 9f7d99e9aa7fe85c6951d2f60361766e76c7bdfe
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
#!/bin/sh
 
sn=`sn`
if [ $? -eq 0 ]
then
    sqlite3 /work/iot_cfg.db  "update machine set id='FZ$sn'"
    if [ $? -eq 0 ]
    then
        echo "update sn[FZ$sn] ok!"
    else 
        echo "error!"
    fi
else 
    echo "not found sn."
fi
 
 
#update mac
sn=`sn`
mac=0A:84:7F:
 
mac=$mac`echo ${sn:8:2}`":" 
mac=$mac`echo ${sn:10:2}`":" 
mac=$mac`echo ${sn:12:2}` 
#echo "mac: $mac"
/usr/sbin/jsoner -s /work/config.json eth0.mac \"$mac\"
echo "update mac1[$mac] ok!"
 
mac=0A:84:7E:
 
mac=$mac`echo ${sn:8:2}`":" 
mac=$mac`echo ${sn:10:2}`":" 
mac=$mac`echo ${sn:12:2}` 
/usr/sbin/jsoner -s /work/config.json eth1.mac \"$mac\"
echo "update mac2[$mac] ok!"