Jun 21

这个脚本可以批量删除 NVRAM 中以某些字符串开头的内容:


#/bin/sh
#scriptname: nvram_unset_pro
for _TEMPVAR in `nvram show 2>/dev/null|grep "^$1"|cut -d'=' -f1`;
	do nvram unset $_TEMPVAR;
done

用法:


nvram_unset_pro bt_

这样就删除了所有 bt_ 开头的设置项。

记得删除完成后用


nvram commit

提交,否则路由器重启后又会生成。

Tags:

Nov 07

一、下载源程序


git clone https://github.com/semigodking/redsocks.git

二、编译


cd redsocks-master
make

会出错:


parser.c: In function 'vp_in_addr':
parser.c:306: error: 'AI_ADDRCONFIG' undeclared (first use in this function)
parser.c:306: error: (Each undeclared identifier is reported only once
parser.c:306: error: for each function it appears in.)
make: *** [parser.o] Error 1

三、解决,在parser.c文件的第32行插入如下代码:


#ifndef AI_ADDRCONFIG
#define AI_ADDRCONFIG 0x0020
#endif


Oct 21

下载源码: https://github.com/madeye/shadowsocks-libev

直接编译会出错:

/tmp/cciqCfzf.s: Assembler messages:
/tmp/cciqCfzf.s:2903: Error: opcode not supported on this processor: mips1 (mips1) `sync'

修改 \shadowsocks-libev-master\libev 下的 ev.c :

找到 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")

改为 #define ECB_MEMORY_FENCE __asm__ __volatile__ (".set mips2; sync; .set mips0" ::: "memory")

有两处,都改吧。(参考:http://permalink.gmane.org/gmane.comp.lib.ev/2182)

再编译就可以通过了:

Shadowsocks.1.4.0.Tomato.gif


Aug 14

网上的都要用到 find -mtime,这个参数默认的 busybox 是不支持的,当然你可以下 findunti ,我这个脚本无需额外的程序支持:


#!/bin/sh
# optware backup
# Sun Feb 19 00:34:42 CST 2012
# by Punk

keep=3                                                #保留历史备份数
backup_source="opt"                            #需要备份的目录,不可有/开头
backup_dest="/cifs2/hdtv/!opt_bak/"      #备份文件存储目录
date=`date +%Y-%m-%d`
hostname=$(hostname -s)
prename="$hostname-optware"
filename="$prename-$date.tgz"

delete_old() {
echo Deleting old backup of Optware...
totalline=`find "$backup_dest" -name "$prename*.tgz" | wc -l`
if [ $totalline -ge $keep ];then
    dell=$(($totalline-$keep))
    find "$backup_dest" -name "$prename-*.tgz" | sort | head -n $dell | xargs rm -rf
fi
echo Deleting old backup of Optware Finished!
}

backup() {
echo "Backing Up Your Optware System..."
tar czf $backup_dest/$filename -C / $backup_source
echo "Optware Backup Finished!"
}
backup
delete_old


Jun 03


1478 for PPPoA/VC-MUX

1470 for PPPoA/LLC

1446 for PPPoE over ATM/LLC

Tags: ,

[1/44]  1 2 3 4 5 6 7 8 9 10 > ... Last »