RT-IPC_camera/bin/vslocal/cgi-bin/resetdef.sh

36 lines
620 B
Bash
Raw Permalink Normal View History

2023-03-31 22:47:53 -06:00
#!/bin/sh
config_mtd="/dev/mtd4"
etc_mtd="/dev/mtd3"
##保存一些特定值
devid=`paraconf r 2 devid`
upg_crc=`paraconf r 2 upg_crc`
###刷除config分区
flash_eraseall ${config_mtd}
flashcp /bin/vslocal/config.bin ${config_mtd}
###恢复etc分区
tar -xf /bin/vslocal/etc.tar -C /etc/
####恢复P2P密码
P2P_PWD_BK=`paraconf r 1 P2P_PWD_BK`
if [ "${P2P_PWD_BK}" == "null" ];then
P2P_PWD_BK="admin"
fi
STRING="P2P_PWD ${P2P_PWD_BK}"
if [ "${devid}" != "null" ];then
STRING="${STRING} devid "${devid}
fi
if [ "${upg_crc}" != "null" ];then
STRING="${STRING} upg_crc "${upg_crc}
fi
paraconf w 2 ${STRING}