找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
楼主: 小橙

【16-01-11】hiboy固件使用教程

 火... [复制链接]
发表于 2016-2-6 19:10 | 显示全部楼层
很详细  很棒。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-14 02:41 来自手机 | 显示全部楼层
非常详细,谢谢楼主!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-15 13:40 | 显示全部楼层
多谢楼主的分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-15 17:23 | 显示全部楼层
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-15 19:39 | 显示全部楼层
#!/bin/sh
#copyright by hiboy
[ -f /tmp/script1.lock ] && exit 0
touch /tmp/script1.lock
. /etc/storage/script0_script.sh

http_username=`nvram get http_username`
export PATH=/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/opt/lib:/lib
cat > "/etc/storage/cron/crontabs/$http_username" <<EOF
$res
EOF
chmod 777 "/etc/storage/cron/crontabs/$http_username"
sed -e '/.*o-resolv/d' -e '/.*不使用/d' -e '/.*DNS本地监控端口/d' -e '/.*rver=127/d' -e '/.*nf-dir/d' -e '/.*用来自定义/d' -e '/.*orward-max/d' -e '/.*最大并发连接数/d' -e '/.*in-cache-ttl/d' -e '/.*NS缓存最小有效/d' -i /etc/storage/dnsmasq/dnsmasq.conf
restart_dhcpd
logger -t "自定义脚本1" "20秒开始脚本"
sleep 20
/etc/storage/inet_state_script.sh 20
upanPath=`ls -l /media/ | awk '/^d/ {print $NF}' | sed -n '1p'`
cat > "/tmp/sh_downloads_adblock.sh" <<-EOF
#!/bin/sh
adblocks=$adblocks
lazy="http://update.adbyby.com/rule3/lazy.txt"
video="http://update.adbyby.com/rule3/video.txt"
rm -f /tmp/data/lazy.txt
rm -f /tmp/data/video.txt
rm -f /tmp/data/lazy.bin
rm -f /tmp/data/video.bin
rm -f /tmp/data/user.bin
rm -f /tmp/data/user.txt
sed -e '/.*update.adbyby.com/d' -i /etc/storage/dnsmasq/hosts
restart_dhcpd
sleep 5
/tmp/sh_download.sh /tmp/data/lazy.txt \$lazy \$lazy
/tmp/sh_download.sh /tmp/data/video.txt \$video \$video
echo '127.0.0.1 update.adbyby.com' >> /etc/storage/dnsmasq/hosts
restart_dhcpd
if [ "\$adblocks" != "0" ] ; then
mkdir -p /tmp/data
logger -t "adbyby" "下载adblock规则"
while read line
do
c_line=\`echo \$line |grep -v "#"\`
if [ ! -z "\$c_line" ] ; then
rm -f /tmp/data/user2.txt
logger -t "adbyby" "下载规则:\$line"
/tmp/sh_download.sh /tmp/data/user2.txt \$line \$line
grep -v '^!' /tmp/data/user2.txt | grep -E '^(@@\\||\\||[[:alnum:]])' | sort -u  >> /tmp/data/user.txt
rm -f /tmp/data/user2.txt
fi
done < /tmp/rule_DOMAIN.txt
fi
grep -v '^!' /etc/storage/adbyby_rules_script.sh >> /tmp/data/user.txt
EOF
chmod 777 "/tmp/sh_downloads_adblock.sh"

cat > "/tmp/sh_white_list.sh" <<-EOF
#!/bin/sh
whitelist=$whitelist
if [ "\$whitelist" != "0" ] ; then
logger -t "adbyby" "添加过滤白名单地址"
while read line
do
c_line=\`echo \$line |grep -v "#"\`
if [ ! -z "\$c_line" ] ; then
logger -t "adbyby" "加白地址:\$line"
sed -Ei "/\$line/d" /tmp/data/lazy.txt /tmp/data/video.txt /tmp/data/user.txt
fi
done < /tmp/white_list_DOMAIN.txt

fi

EOF
chmod 777 "/tmp/sh_white_list.sh"

cat > "/tmp/sh_func_load_adbyby.sh" <<-EOF
#!/bin/sh
adbybys=$adbybys
adbybyfile=$adbybyfile
adbybyfile2=$adbybyfile2
adblocks=$adblocks
if [ "\$adbybys" != "0" ] ; then
/tmp/sh_adb8118.sh D
killall adbyby
if [ ! -s "/tmp/adbyby" ] ;then
rm -f /tmp/adbyby
logger -t "adbyby" "开始下载7620n.tar.gz"
/tmp/sh_download.sh /tmp/7620n.tar.gz \$adbybyfile \$adbybyfile2
/tmp/sh_untar.sh /tmp/7620n.tar.gz /tmp /tmp/adbyby
fi
if [ -s "/tmp/adbyby" ] ;then
touch /tmp/cron_adb.lock
chmod 777 /tmp/adbyby
/tmp/sh_downloads_adblock.sh
/tmp/sh_white_list.sh
/tmp/adbyby > /tmp/adbyby.log&
sleep 5
rm -f /tmp/adbyby.log
/tmp/adbyby > /tmp/adbyby.log&
sleep 5
killall adbyby
/tmp/adbyby& > /dev/null
if [ "\$adblocks" != "0" ] ; then
logger -t "adbyby" "加载adblock规则,等候60秒"
sleep 60
else
sleep 20
fi
adbyby_log=\`cat /tmp/adbyby.log\`
logger -t "adbyby" "\$adbyby_log"
fi
if [ -s "/tmp/adbyby.log" ] ;then
#/tmp/sh_adb8118.sh A
logger -t "adbyby" "启动完成"
rm -f /tmp/adbyby.log
rm -f /tmp/7620n.tar.gz
rm -f /tmp/cron_adb.lock
logger -t "adbyby" "lazy更新:\`sed -n '1p' /tmp/data/lazy.txt\`"
logger -t "adbyby" "video更新:\`sed -n '1p' /tmp/data/video.txt\`"
rm -f /tmp/data/lazy.txt
rm -f /tmp/data/video.txt
rm -f /tmp/data/user.txt
fi
fi
}

EOF
chmod 777 "/tmp/sh_func_load_adbyby.sh"
sleep 5
/tmp/sh_func_load_adbyby.sh
if [ ! -s "/tmp/adbyby" ] ;then
rm -f /tmp/7620n.tar.gz
logger -t "adbyby" "功能关闭"
else
/tmp/sh_mon.sh&
cat >> "/etc/storage/cron/crontabs/$http_username" <<-EOF
$crons
EOF
if [ "$CPUAverages" != "0" ] ; then
/tmp/sh_CPUAverage.sh&
fi
fi
optw_enable=`nvram get optw_enable`
if [ "$syncys" != "0" ] || [ "$FastDicks" != "0" ] || [ "$ssproxys" != "0" ] || [ "$phddns" != "0" ] && [ "$installs" = "1" ] ; then
logger -t "SS" "optU盘安装,模式:$installs"
if [ "$optw_enable" = "2" ] ; then
SSPath="/media/$upanPath/opt"
if [ ! -x "$SSPath" ]; then
mkdir -p /media/$upanPath/opt
mount -o bind /media/$upanPath/opt /opt
fi
/tmp/sh_installs.sh $ssfile
else
logger -t "opt" "需要开启Entware运行环境,请插入U盘,按要求设置"
syncys=0
ssproxys=0
installs=0
FastDicks=0
fi
fi
if [ "$ssproxys" != "0" ] && [ "$installs" = "2" ] ; then
logger -t "SS" "opt内存安装,模式:$installs,不能使用百度云、迅雷快鸟"
if [ "$optw_enable" = "0" ] ; then
mkdir -p /tmp/opt
mount -o bind /tmp/opt /opt
/tmp/sh_installs.sh $ssfile2
rm -f /opt/opt.tgz
FastDicks=0
syncys=0
else
logger -t "SS" "需要关闭Entware运行环境,请按要求设置"
syncys=0
ssproxys=0
installs=0
FastDicks=0
fi
fi
if [ ! -s "/opt/s-s" ] ;then
ssproxys=0
logger -t "SS" "opt缺少s-s文件,请更新opt文件夹、检查U盘文件和Entware设置"
fi
if [ "$ssproxys" != "0" ] ; then
/tmp/sh_dnsmasqs.sh $gfwlists
restart_dhcpd
logger -t "SS" "30秒开始脚本"
sleep 30
logger -t "SS" "生成服务器配置文件"
cat > "/opt/etc/s-s.json" <<-EOF
{
"server":"$server_ip",
"server_port"server_port,
"local_address":"0.0.0.0",
"local_port":1080,
"password":"$server_password",
"timeout":60,
"method":"$server_method"
}

EOF
if [ "$ssproxys" = "1" ] ; then
if [ "$gfwlists" = "1" ] ; then
logger -t "SS" "$ssproxys【1;方案一】"
/opt/s-s ipset
sleep 5
/opt/s-s rules
sleep 5
/opt/etc/init.d/S22s-s restart
/opt/etc/init.d/S24chinadns restart
else
logger -t "SS" "$ssproxys【2;方案二】"
/opt/etc/init.d/S24chinadns stop
/opt/s-s ipset
sleep 5
/tmp/sh_ssgfwlist.sh
sleep 5
/opt/etc/init.d/S22s-s restart
fi
fi
if [ "$ssproxys" = "2" ] ; then
logger -t "SS" "$ssproxys【全部走代理】"
/tmp/sh_dnsmasqs.sh 1
/opt/etc/init.d/S24chinadns restart
/opt/s-s ipset
/opt/s-s global
/opt/etc/init.d/S22s-s restart
/opt/etc/init.d/S24chinadns restart
fi
/tmp/sh_ssmon.sh $gfwlists&
cat >> "/etc/storage/cron/crontabs/$http_username" <<-EOF
$updates
EOF
fi
if [ "$ssproxys" = "0" ] ; then
logger -t "SS" "自动删除dnsmasqs配置"
/tmp/sh_dnsmasqs.sh 0
if [ -s "/opt/etc/init.d/S22s-s" ] ;then
/opt/etc/init.d/S22s-s stop
fi
if [ -s "/opt/etc/init.d/S24chinadns" ] ;then
/opt/etc/init.d/S24chinadns stop
fi
fi
restart_dhcpd
if [ ! -s "/opt/etc/syncy.py" ] ;then
syncys=0
logger -t "syncy" "opt缺少syncy.py文件,请更新opt文件夹、检查U盘文件和Entware设置"
fi
if [ "$syncys" != "0" ] ; then
logger -t "syncy" "启动syncy服务"
sed -i 's/\r//g' /opt/etc/syncy
python /opt/etc/syncy.py &
sleep 20
/tmp/sh_syncyquota.sh&
fi
crond
if [ "$xunleis" != "0" ] ; then
/tmp/sh_xun_lei.sh $xunleis /media/$upanPath/xunlei &
fi
if [ "$FastDicks" != "0" ] ; then
/tmp/sh_FastDick.sh $FastDicks $uid $pwd &
fi
if [ ! -s "/opt/phddns2/oraynewph.sh" ] ;then
phddns=0
logger -t "花生壳内网版" "opt缺少oraynewph.sh文件,请更新opt文件夹、检查U盘文件和Entware设置"
fi
if [ "$phddns" != "0" ] ; then
/opt/phddns2/oraynewph.sh start &
sleep 10
/opt/phddns2/oraynewph.sh status &
fi
logger -t "自定义脚本1" "脚本完成"
rm -f /tmp/script1.lock
我这里代码是这样子的  根本看不懂
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-17 00:24 | 显示全部楼层
我想问下怎么自定义让有的网站不走代理?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-21 21:02 | 显示全部楼层
斐讯1208刷了固件,ss脚本不能用,在扩展功能设置里面显示是开启了的,但右上角开关显示关闭,点了开关没反应,log显示:【按钮②】: SS,【按钮②】: 开启s-s进程,SS: 脚本完成

另外我加密方式是chacha20,有没有影响?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-21 23:06 来自手机 | 显示全部楼层
谢谢楼主
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

头像被屏蔽
发表于 2016-2-26 20:57 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-2-29 13:17 | 显示全部楼层
学习了,慢慢琢磨一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-3-3 11:09 | 显示全部楼层
谢谢楼主,太需要了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-3-3 19:38 | 显示全部楼层
请问如何设置 定时打开关闭无线的脚 本。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-3-4 19:03 | 显示全部楼层
谢谢楼主的贴,我的adbyby搞定了。
有个问题就是,我的脚本里面的ss代码,和你们的完全都不一样,关于ss的代码,我的就非常短一段的,连刷入ip和密码的那段代码都没有,重刷固件和升级固件都没用,恢复也没有。
ss一直搞不定,不知道该怎么办了,楼主能帮帮我吗!万分感谢

点评

最新版的固件在扩展设置里就可以直接设置了 不需要再到脚本里设置  详情 回复 发表于 2016-3-4 20:43
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-3-4 20:43 | 显示全部楼层
大血大 发表于 2016-3-4 19:03
谢谢楼主的贴,我的adbyby搞定了。
有个问题就是,我的脚本里面的ss代码,和你们的完全都不一样,关于ss的 ...

最新版的固件在扩展设置里就可以直接设置了  不需要再到脚本里设置

点评

我adbyby和ss都在扩展设置里面设置了却没用,adbyby在脚本里面改了一下就有用了,ss搞不定了  详情 回复 发表于 2016-3-4 20:56
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-3-4 20:56 | 显示全部楼层
小橙 发表于 2016-3-4 20:43
最新版的固件在扩展设置里就可以直接设置了  不需要再到脚本里设置

我adbyby和ss都在扩展设置里面设置了却没用,adbyby在脚本里面改了一下就有用了,ss搞不定了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-28 17:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表