linux 共享 无线路由,发个我在DD-WRT无线路由器上写的一个简单脚本,linux玩的就是共享!...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#!/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};

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值