lgq
2025-05-26 0e3ba084acf8e7b880a19ef6107d77a8cab1f83a
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
#!/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 mac[$mac] ok!"