add lean packages to my packages feed

This commit is contained in:
coolsnowwolf 2018-10-19 12:40:59 +08:00
parent 291e3b74e8
commit b2f0d3c49b
502 changed files with 87574 additions and 0 deletions

70
lean/adbyby/Makefile Normal file
View File

@ -0,0 +1,70 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=adbyby
PKG_VERSION:=2.7
PKG_RELEASE:=20181008
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Powerful adblock module to block ad.
DEPENDS:=
URL:=http://www.adbyby.com/
endef
define Package/$(PKG_NAME)/description
Adbyby is a powerful adblock module to block ad,just like adblock.
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/share/adbyby
$(INSTALL_BIN) ./files/adbyby.sh $(1)/usr/share/adbyby/
$(INSTALL_BIN) ./files/adbybyfirst.sh $(1)/usr/share/adbyby/
$(INSTALL_BIN) ./files/adbybyupdate.sh $(1)/usr/share/adbyby/
$(INSTALL_CONF) ./files/adhook.ini $(1)/usr/share/adbyby/
$(INSTALL_CONF) ./files/user.action $(1)/usr/share/adbyby/
$(INSTALL_DIR) $(1)/usr/share/adbyby/data
$(INSTALL_DATA) ./files/data/* $(1)/usr/share/adbyby/data/
$(INSTALL_DIR) $(1)/usr/share/adbyby/doc
$(INSTALL_DATA) ./files/doc/* $(1)/usr/share/adbyby/doc/
ifeq ($(ARCH),mipsel)
$(INSTALL_BIN) ./files/7620n/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),mips)
$(INSTALL_BIN) ./files/ar71xx/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),i386)
$(INSTALL_BIN) ./files/x86/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),x86_64)
$(INSTALL_BIN) ./files/x86_64/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),arm)
$(INSTALL_BIN) ./files/arm/adbyby $(1)/usr/share/adbyby/
endif
ifeq ($(ARCH),aarch64)
$(INSTALL_BIN) ./files/armv7/adbyby $(1)/usr/share/adbyby/
endif
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

BIN
lean/adbyby/files/7620n/adbyby Executable file

Binary file not shown.

16
lean/adbyby/files/adbyby.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
err=0
until [ $err -ge 5 ]; do
if [ -n "$(pgrep $PROG_PATH/adbyby)" ]; then
iptables-save | grep ADBYBY >/dev/null || \
/etc/init.d/adbyby add_rule
sleep 10
err=0
else
$PROG_PATH/adbyby --no-daemon &>/dev/null &
sleep 1
err=$((err+1))
fi
done
/etc/init.d/adbyby del_rule

View File

@ -0,0 +1,11 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
if [ -z "$(dnsmasq --version | grep no-ipset)" ]; then
[ $(uci get adbyby.@adbyby[-1].wan_mode) -ne 2 ] && \
[ $(awk -F= '/^ipset/{print $2}' $PROG_PATH/adhook.ini) -eq 1 ] && \
{
sed -i 's/adbyby_list/adbyby_wan/' /tmp/adbyby_host.conf
echo conf-file=/tmp/adbyby_host.conf >> /etc/dnsmasq.conf
/etc/init.d/dnsmasq restart
}
fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
if [ -z "$(dnsmasq --version | grep no-ipset)" ]; then
[ $(uci get adbyby.@adbyby[-1].wan_mode) -ne 2 ] && \
[ $(awk -F= '/^ipset/{print $2}' $PROG_PATH/adhook.ini) -eq 1 ] && \
{
sed -i 's/adbyby_list/adbyby_wan/' /tmp/adbyby_host.conf
ipset -F adbyby_wan 2>/dev/null
/etc/init.d/dnsmasq restart
}
fi

View File

@ -0,0 +1,14 @@
[cfg]
### 2.1 ###
listen-address=0.0.0.0:8118
buffer-limit=1024
keep-alive-timeout=30
socket-timeout=60
### 2.5 ###
max_client_connections=0
### 2.6 ###
stack_size=200
auto_restart=0
### 2.7 ###
debug=0
ipset=0

BIN
lean/adbyby/files/ar71xx/adbyby Executable file

Binary file not shown.

BIN
lean/adbyby/files/arm/adbyby Executable file

Binary file not shown.

BIN
lean/adbyby/files/armv7/adbyby Executable file

Binary file not shown.

View File

@ -0,0 +1,121 @@
//IE6、7、8、9, from adsafe
%USERPROFILE%\Local Settings\Temporary Internet Files\*.html
%USERPROFILE%\Local Settings\Temporary Internet Files\*.js
%USERPROFILE%\Local Settings\Temporary Internet Files\*.htm
%USERPROFILE%\Local Settings\Temporary Internet Files\*.xml
%USERPROFILE%\Local Settings\Temporary Internet Files\*.css
%USERPROFILE%\Local Settings\Temporary Internet Files\*.swf
%USERPROFILE%\Local Settings\Temporary Internet Files\*.flv
%USERPROFILE%\Local Settings\Temporary Internet Files\*.mp4
%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\*.*
%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*
%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\*.*
//360安全浏览器
%USERPROFILE%\Application Data\360se\ie8data\Temporary Internet Files\*.*
//chrome
%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Cache\*.*
//360极速浏览器
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\CacheIE\*.*
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Cache\*.*
%USERPROFILE%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\CacheIE\Content.IE5\*.*
//搜狗浏览器
%USERPROFILE%\Application Data\SogouExplorer\Webkit\Default\Cache\*.*
%USERPROFILE%\AppData\Roaming\SogouExplorer\Webkit\Default\Cache\*.*
//opera浏览器
%USERPROFILE%\AppData\Local\Opera\Opera\cache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\cache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\application_cache\mcache\*.*
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\application_cache\cache_groups.xml
%USERPROFILE%\Local Settings\Application Data\Opera\Opera\opcache\*.*
//淘宝浏览器
%USERPROFILE%\AppData\Local\TaoBrowser\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\TaoBrowser\User Data\Default\JumpListIcons\*.*
%USERPROFILE%\Local Settings\Application Data\TaoBrowser\User Data\Default\Cache\*.*
//百度浏览器
%USERPROFILE%\Application Data\Baidu\browser\DiskCache\*.*
%USERPROFILE%\AppData\Roaming\Baidu\browser\DiskCache\*.*
//猎豹浏览器
%USERPROFILE%\Local Settings\Application Data\liebao\User Data\Default\Cache\*.*
%USERPROFILE%\Local Settings\Application Data\liebao\User Data\iecache\Content.IE5\*.*
%USERPROFILE%\AppData\Local\liebao\User Data\Default\Cache\*.*
%USERPROFILE%\AppData\Local\liebao\User Data\Default\JumpListIcons\*.*
//Letv
%USERPROFILE%\Application Data\Letv\Logg\*.log
//PPSStream
%APPDATA%\PPStream\adsys\*.*
%APPDATA%\PPStream\banner\*.*
%APPDATA%\PPStream\notice\*.*
%APPDATA%\PPStream\CLCache\*.pld
%APPDATA%\PPStream\FDSCache\*.blf
//PPTV
%APPDATA%\PPLive\PPTV\cache\*.*
//风行
%USERPROFILE%\funshion\cache\*.*
//youku
-s%appdata%\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//letv
-s%appdata%\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//iqiyi
-s%appdata%\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//chrome YOUKU
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//chrome LeTv
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//chrome iqiyi
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//360 youku
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//360 letv
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//360 iqiyi
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//暴风影音5
%ALLUSERSPROFILE%\Baofeng\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Baofeng\StormPlayer\Profiles\vod\*.*
%ALLUSERSPROFILE%\Application Data\Baofeng\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Application Data\Baofeng\StormPlayer\Profiles\vod\*.*
%ALLUSERSPROFILE%\Baofeng\Application Data\StormPlayer\Profiles\md\*.*
%ALLUSERSPROFILE%\Baofeng\Application Data\StormPlayer\Profiles\vod\*.*
//pptv
%ALLUSERSPROFILE%\PPLive\PPTV\Cache\pluginad\*.*
%ALLUSERSPROFILE%\Application Data\PPLive\PPTV\Cache\pluginad\*.*
%ALLUSERSPROFILE%\Application Data\PPLive\PPTV\screensaver\*.*
//多米
C:\Program Files\DuoMi\dmdeskinfo.exe
//UUSEE
%TEMP%\UUFile\*.*
//iqiyi
%ALLUSERSPROFILE%\Application Data\Qiyi\qiyiclient\cache\*.*

View File

@ -0,0 +1,43 @@
//youku
-y%appdata%\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//youku win7
-y%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\YOUKU_FSO_PROXY.sol
//chrome YOUKU
-y%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//360 youku
-y%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//sougou youku
-y%appdata%\SogouExplorer\Webkit\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\UCBrowser\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
-y%userprofile%\Local Settings\Application Data\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\YOUKU_FSO_PROXY.sol
//qq
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\*.*
%appdata%\Tencent\QQ\Misc\com.tencent.advertisement\GDT_0\*.*
//letv
-s%appdata%\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//letv1
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\com.letv.sol
//iqiyi
-s%appdata%\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//iqiyi1
-s%APPDATA%\Roaming\Macromedia\Flash Player\#SharedObjects\qiyi_statistics.sol
//chrome LeTv
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//chrome iqiyi
-s%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol
//360 letv
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\com.letv.sol
//360 iqiyi
-s%USERPROFILE%\AppData\Local\360Chrome\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\qiyi_statistics.sol

Binary file not shown.

View File

@ -0,0 +1 @@
! -----更新时间: 2018-06-10 12:56:28 by:xwhyc-----

View File

@ -0,0 +1,15 @@
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
! -------------- 规则基于abp规则并进行了字符替换部分的扩展-----------------------------
! ABP规则请参考https://adblockplus.org/zh_CN/filters下面为大致摘要
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
! "*" 为字符通配符能够匹配0长度或任意长度的字符串该通配符不能与正则语法混用。
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
! "|" 为管线符号,来表示地址的最前端或最末端
! "||" 为子域通配符,方便匹配主域名下的所有子域。
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
! "##" 为元素选择器标识符后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
!! 元素隐藏暂不支持全局规则和排除规则
!! 字符替换扩展
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
! 支持通配符*和?
! -------------------------------------------------------------------------------------------

View File

View File

@ -0,0 +1,23 @@
! -----更新时间: 2018-06-13 22:56:37 by:xwhyc-----------------------------------------------
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满)470705224534897434,438394572--------------
!-------------------------------------------
twmeiju.com##iframe[width="336"]
txzqw##.ad-text,.tac,#banner,[id^="ads_"]
|http://*.com/logo/ad.js
|http://*.com/logo/logo.js
|http://*.com/logo/logoxia.js
|http://*.com/logo/playjs.js
|http://m.haxdu.com/hi18/$script
|http://www.hqck.net/templets/default/js/ntes_jslib_1.x.js
||51wady.com/me.php?id=
||haxwx3.com/web/js/$script
||jiawen88.com
!-----------------------
!---------adbyby---------

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,10 @@
;¸üйæÔòurl,dir,size,reverse,reverse
http://update.adbyby.com/rule3/lazy.jpg \data\lazy.txt 385337 4 0
http://update.adbyby.com/rule3/video.jpg \data\video.txt 1028 4 0
http://update.adbyby.com/rule3/user.action \user.action 512 5 0
http://update.adbyby.com/rule3/clean.ini \data\clean.ini 2167 0 0
http://update.adbyby.com/rule3/adclear.ini \data\adclear.ini 4901 0 0
https://github.com/gchangchen/suho/raw/master/adhook.dll \adhook.dll 117248 0 0 2.4.3.2
https://github.com/gchangchen/suho/raw/master/adhook64.dll \adhook64.dll 142848 0 0 2.4.3.2
https://github.com/gchangchen/suho/raw/master/adbyby.exe \adbyby.exe 1004183 1 0 2.4.4.0

View File

@ -0,0 +1,9 @@
{+fast-redirects{s@&plid=\d+&uid=@&plid=7038006&uid=@} }
hot.vrs.sohu.com/vrs_flash.action\?vid=
{+fast-redirects{s@/Main.swf\?(?!plid)@/Main.swf?plid=7038006&@} }
tv.sohu.com/upload/swf/201.*?/Main.swf\?
{+fast-redirects{s@http://tv.sohu.com/upload/swf/.*?/PlayerShell.swf@http://update.adbyby.com/swf/sohu_livezb.swf@} }
tv.sohu.com/upload/swf/.*?/PlayerShell.swf\?
{+fast-redirects{s@pl.youku.com/playlist/m3u8\?keyframe=0&.*@update.adbyby.com/youku.m3u8@} }
pl.youku.com/playlist/m3u8\?keyframe=0&

BIN
lean/adbyby/files/x86/adbyby Executable file

Binary file not shown.

BIN
lean/adbyby/files/x86_64/adbyby Executable file

Binary file not shown.

37
lean/autocore/Makefile Normal file
View File

@ -0,0 +1,37 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autocore
PKG_VERSION:=1
PKG_RELEASE:=15
include $(INCLUDE_DIR)/package.mk
define Package/autocore
TITLE:=x86/x64 auto core loadbalance script.
MAINTAINER:=Lean
DEPENDS:=@TARGET_x86 +bc +lm-sensors +ethtool
endef
define Package/autocore/description
A usb autoconfig hotplug script.
endef
define Build/Compile
endef
define Package/autocore/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/autocore $(1)/etc/init.d/autocore
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DATA) ./files/index.htm $(1)/etc/index.htm
endef
$(eval $(call BuildPackage,autocore))

64
lean/autocore/files/autocore Executable file
View File

@ -0,0 +1,64 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2017 lean <coolsnowwolf@gmail.com>
START=99
start()
{
rfc=4096
cc=$(grep -c processor /proc/cpuinfo)
rsfe=$(echo $cc*$rfc | bc)
sysctl -w net.core.rps_sock_flow_entries=$rsfe
for fileRps in $(ls /sys/class/net/eth*/queues/rx-*/rps_cpus)
do
echo $cc > $fileRps
done
for fileRfc in $(ls /sys/class/net/eth*/queues/rx-*/rps_flow_cnt)
do
echo $rfc > $fileRfc
done
for fileRps in $(ls /sys/class/net/eth*/queues/tx-*/xps_cpus)
do
echo $cc > $fileRps
done
a=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq)
b=$(echo -n ' : ')
c=$(cat /proc/cpuinfo | grep 'core id' | sort -u | wc -l)
d=$(echo -n ' Core ')
e=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
f=$(echo -n ' Thread ')
g=${a}${b}${c}${d}${e}${f}
echo $g > /tmp/sysinfo/model
ethtool -K eth0 rx-checksum on >/dev/null 2>&1
ethtool -K eth0 tx-checksum-ip-generic on >/dev/null 2>&1
ethtool -K eth0 tso on >/dev/null 2>&1
ethtool -K eth0 ufo on >/dev/null 2>&1
ethtool -K eth0 gso on >/dev/null 2>&1
ethtool -K eth1 rx-checksum on >/dev/null 2>&1
ethtool -K eth1 tx-checksum-ip-generic on >/dev/null 2>&1
ethtool -K eth1 tso on >/dev/null 2>&1
ethtool -K eth1 ufo on >/dev/null 2>&1
ethtool -K eth1 gso on >/dev/null 2>&1
ethtool -K eth2 rx-checksum on >/dev/null 2>&1
ethtool -K eth2 tx-checksum-ip-generic on >/dev/null 2>&1
ethtool -K eth2 tso on >/dev/null 2>&1
ethtool -K eth2 ufo on >/dev/null 2>&1
ethtool -K eth2 gso on >/dev/null 2>&1
ethtool -K eth3 rx-checksum on >/dev/null 2>&1
ethtool -K eth3 tx-checksum-ip-generic on >/dev/null 2>&1
ethtool -K eth3 tso on >/dev/null 2>&1
ethtool -K eth3 ufo on >/dev/null 2>&1
ethtool -K eth3 gso on >/dev/null 2>&1
[ -f /etc/index.htm ] && mv /etc/index.htm /usr/lib/lua/luci/view/admin_status/index.htm
}

View File

@ -0,0 +1,830 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
Licensed to the public under the Apache License 2.0.
-%>
<%
local fs = require "nixio.fs"
local util = require "luci.util"
local stat = require "luci.tools.status"
local ver = require "luci.version"
local has_ipv6 = fs.access("/usr/sbin/ip6tables")
local has_dhcp = fs.access("/etc/config/dhcp")
local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0)
local sysinfo = luci.util.ubus("system", "info") or { }
local boardinfo = luci.util.ubus("system", "board") or { }
local unameinfo = nixio.uname() or { }
local meminfo = sysinfo.memory or {
total = 0,
free = 0,
buffered = 0,
shared = 0
}
local swapinfo = sysinfo.swap or {
total = 0,
free = 0
}
local has_dsl = fs.access("/etc/init.d/dsl_control")
if luci.http.formvalue("status") == "1" then
local ntm = require "luci.model.network".init()
local wan = ntm:get_wannet()
local wan6 = ntm:get_wan6net()
local conn_count = tonumber(
fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0
local conn_max = tonumber(luci.sys.exec(
"sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max"
):match("%d+")) or 4096
local rv = {
uptime = sysinfo.uptime or 0,
localtime = os.date(),
loadavg = sysinfo.load or { 0, 0, 0 },
memory = meminfo,
swap = swapinfo,
connmax = conn_max,
conncount = conn_count,
leases = stat.dhcp_leases(),
leases6 = stat.dhcp6_leases(),
wifinets = stat.wifi_networks()
}
if wan then
rv.wan = {
ipaddr = wan:ipaddr(),
gwaddr = wan:gwaddr(),
netmask = wan:netmask(),
dns = wan:dnsaddrs(),
expires = wan:expires(),
uptime = wan:uptime(),
proto = wan:proto(),
ifname = wan:ifname(),
link = wan:adminlink()
}
end
if wan6 then
rv.wan6 = {
ip6addr = wan6:ip6addr(),
gw6addr = wan6:gw6addr(),
dns = wan6:dns6addrs(),
ip6prefix = wan6:ip6prefix(),
uptime = wan6:uptime(),
proto = wan6:proto(),
ifname = wan6:ifname(),
link = wan6:adminlink()
}
end
if has_dsl then
local dsl_stat = luci.sys.exec("/etc/init.d/dsl_control lucistat")
local dsl_func = loadstring(dsl_stat)
if dsl_func then
rv.dsl = dsl_func()
end
end
luci.http.prepare_content("application/json")
luci.http.write_json(rv)
return
elseif luci.http.formvalue("hosts") == "1" then
luci.http.prepare_content("application/json")
luci.http.write_json(luci.sys.net.host_hints())
return
end
-%>
<%+header%>
<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-18.143.28733-7acacf2"></script>
<script type="text/javascript">//<![CDATA[
function progressbar(v, m)
{
var vn = parseInt(v) || 0;
var mn = parseInt(m) || 100;
var pc = Math.floor((100 / mn) * vn);
return String.format(
'<div style="width:200px; position:relative; border:1px solid #999999">' +
'<div style="background-color:#CCCCCC; width:%d%%; height:15px">' +
'<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:#000000">' +
'<small>%s / %s (%d%%)</small>' +
'</div>' +
'</div>' +
'</div>', pc, v, m, pc
);
}
function wifirate(bss, rx) {
var p = rx ? 'rx_' : 'tx_',
s = '%.1f <%:Mbit/s%>, %d<%:MHz%>'
.format(bss[p+'rate'] / 1000, bss[p+'mhz']),
ht = bss[p+'ht'], vht = bss[p+'vht'],
mhz = bss[p+'mhz'], nss = bss[p+'nss'],
mcs = bss[p+'mcs'], sgi = bss[p+'short_gi'];
if (ht || vht) {
if (vht) s += ', VHT-MCS %d'.format(mcs);
if (nss) s += ', VHT-NSS %d'.format(nss);
if (ht) s += ', MCS %s'.format(mcs);
if (sgi) s += ', <%:Short GI%>';
}
return s;
}
function duid2mac(duid) {
// DUID-LLT / Ethernet
if (duid.length === 28 && duid.substr(0, 8) === '00010001')
return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase();
// DUID-LL / Ethernet
if (duid.length === 20 && duid.substr(0, 8) === '00030001')
return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase();
return null;
}
var npoll = 1;
var hosts = <%=luci.http.write_json(luci.sys.net.host_hints())%>;
function updateHosts() {
XHR.get('<%=REQUEST_URI%>', { hosts: 1 }, function(x, data) {
hosts = data;
});
}
XHR.poll(5, '<%=REQUEST_URI%>', { status: 1 },
function(x, info)
{
if (!(npoll++ % 5))
updateHosts();
var si = document.getElementById('wan4_i');
var ss = document.getElementById('wan4_s');
var ifc = info.wan;
if (ifc && ifc.ifname && ifc.proto != 'none')
{
var s = String.format(
'<strong><%:Type%>: </strong>%s<br />' +
'<strong><%:Address%>: </strong>%s<br />' +
'<strong><%:Netmask%>: </strong>%s<br />' +
'<strong><%:Gateway%>: </strong>%s<br />',
ifc.proto,
(ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0',
(ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255',
(ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0'
);
for (var i = 0; i < ifc.dns.length; i++)
{
s += String.format(
'<strong><%:DNS%> %d: </strong>%s<br />',
i + 1, ifc.dns[i]
);
}
if (ifc.expires > -1)
{
s += String.format(
'<strong><%:Expires%>: </strong>%t<br />',
ifc.expires
);
}
if (ifc.uptime > 0)
{
s += String.format(
'<strong><%:Connected%>: </strong>%t<br />',
ifc.uptime
);
}
ss.innerHTML = String.format('<small>%s</small>', s);
si.innerHTML = String.format(
'<img src="<%=resource%>/icons/ethernet.png" />' +
'<br /><small><a href="%s">%s</a></small>',
ifc.link, ifc.ifname
);
}
else
{
si.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
ss.innerHTML = '<em><%:Not connected%></em>';
}
<% if has_ipv6 then %>
var si6 = document.getElementById('wan6_i');
var ss6 = document.getElementById('wan6_s');
var ifc6 = info.wan6;
if (ifc6 && ifc6.ifname && ifc6.proto != 'none')
{
var s = String.format(
'<strong><%:Type%>: </strong>%s%s<br />',
ifc6.proto, (ifc6.ip6prefix) ? '-pd' : ''
);
if (!ifc6.ip6prefix)
{
s += String.format(
'<strong><%:Address%>: </strong>%s<br />',
(ifc6.ip6addr) ? ifc6.ip6addr : '::'
);
}
else
{
s += String.format(
'<strong><%:Prefix Delegated%>: </strong>%s<br />',
ifc6.ip6prefix
);
if (ifc6.ip6addr)
{
s += String.format(
'<strong><%:Address%>: </strong>%s<br />',
ifc6.ip6addr
);
}
}
s += String.format(
'<strong><%:Gateway%>: </strong>%s<br />',
(ifc6.gw6addr) ? ifc6.gw6addr : '::'
);
for (var i = 0; i < ifc6.dns.length; i++)
{
s += String.format(
'<strong><%:DNS%> %d: </strong>%s<br />',
i + 1, ifc6.dns[i]
);
}
if (ifc6.uptime > 0)
{
s += String.format(
'<strong><%:Connected%>: </strong>%t<br />',
ifc6.uptime
);
}
ss6.innerHTML = String.format('<small>%s</small>', s);
si6.innerHTML = String.format(
'<img src="<%=resource%>/icons/ethernet.png" />' +
'<br /><small><a href="%s">%s</a></small>',
ifc6.link, ifc6.ifname
);
}
else
{
si6.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
ss6.innerHTML = '<em><%:Not connected%></em>';
}
<% end %>
<% if has_dsl then %>
var dsl_i = document.getElementById('dsl_i');
var dsl_s = document.getElementById('dsl_s');
var s = String.format(
'<strong><%:Status%>: </strong>%s<br />' +
'<strong><%:Line State%>: </strong>%s [0x%x]<br />' +
'<strong><%:Line Mode%>: </strong>%s<br />' +
'<strong><%:Annex%>: </strong>%s<br />' +
'<strong><%:Profile%>: </strong>%s<br />' +
'<strong><%:Data Rate%>: </strong>%s/s / %s/s<br />' +
'<strong><%:Max. Attainable Data Rate (ATTNDR)%>: </strong>%s/s / %s/s<br />' +
'<strong><%:Latency%>: </strong>%s / %s<br />' +
'<strong><%:Line Attenuation (LATN)%>: </strong>%s dB / %s dB<br />' +
'<strong><%:Signal Attenuation (SATN)%>: </strong>%s dB / %s dB<br />' +
'<strong><%:Noise Margin (SNR)%>: </strong>%s dB / %s dB<br />' +
'<strong><%:Aggregate Transmit Power(ACTATP)%>: </strong>%s dB / %s dB<br />' +
'<strong><%:Forward Error Correction Seconds (FECS)%>: </strong>%s / %s<br />' +
'<strong><%:Errored seconds (ES)%>: </strong>%s / %s<br />' +
'<strong><%:Severely Errored Seconds (SES)%>: </strong>%s / %s<br />' +
'<strong><%:Loss of Signal Seconds (LOSS)%>: </strong>%s / %s<br />' +
'<strong><%:Unavailable Seconds (UAS)%>: </strong>%s / %s<br />' +
'<strong><%:Header Error Code Errors (HEC)%>: </strong>%s / %s<br />' +
'<strong><%:Non Pre-emtive CRC errors (CRC_P)%>: </strong>%s / %s<br />' +
'<strong><%:Pre-emtive CRC errors (CRCP_P)%>: </strong>%s / %s<br />' +
'<strong><%:Line Uptime%>: </strong>%s<br />' +
'<strong><%:ATU-C System Vendor ID%>: </strong>%s<br />' +
'<strong><%:Power Management Mode%>: </strong>%s<br />',
info.dsl.line_state, info.dsl.line_state_detail,
info.dsl.line_state_num,
info.dsl.line_mode_s,
info.dsl.annex_s,
info.dsl.profile_s,
info.dsl.data_rate_down_s, info.dsl.data_rate_up_s,
info.dsl.max_data_rate_down_s, info.dsl.max_data_rate_up_s,
info.dsl.latency_num_down, info.dsl.latency_num_up,
info.dsl.line_attenuation_down, info.dsl.line_attenuation_up,
info.dsl.signal_attenuation_down, info.dsl.signal_attenuation_up,
info.dsl.noise_margin_down, info.dsl.noise_margin_up,
info.dsl.actatp_down, info.dsl.actatp_up,
info.dsl.errors_fec_near, info.dsl.errors_fec_far,
info.dsl.errors_es_near, info.dsl.errors_es_far,
info.dsl.errors_ses_near, info.dsl.errors_ses_far,
info.dsl.errors_loss_near, info.dsl.errors_loss_far,
info.dsl.errors_uas_near, info.dsl.errors_uas_far,
info.dsl.errors_hec_near, info.dsl.errors_hec_far,
info.dsl.errors_crc_p_near, info.dsl.errors_crc_p_far,
info.dsl.errors_crcp_p_near, info.dsl.errors_crcp_p_far,
info.dsl.line_uptime_s,
info.dsl.atuc_vendor_id,
info.dsl.power_mode_s
);
dsl_s.innerHTML = String.format('<small>%s</small>', s);
dsl_i.innerHTML = String.format(
'<img src="<%=resource%>/icons/ethernet.png" />' +
'<br /><small>DSL</small>'
);
<% end %>
<% if has_dhcp then %>
var ls = document.getElementById('lease_status_table');
if (ls)
{
/* clear all rows */
while( ls.rows.length > 1 )
ls.rows[0].parentNode.deleteRow(1);
for( var i = 0; i < info.leases.length; i++ )
{
var timestr;
if (info.leases[i].expires === false)
timestr = '<em><%:unlimited%></em>';
else if (info.leases[i].expires <= 0)
timestr = '<em><%:expired%></em>';
else
timestr = String.format('%t', info.leases[i].expires);
var tr = ls.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
tr.insertCell(-1).innerHTML = info.leases[i].hostname ? info.leases[i].hostname : '?';
tr.insertCell(-1).innerHTML = info.leases[i].ipaddr;
tr.insertCell(-1).innerHTML = info.leases[i].macaddr;
tr.insertCell(-1).innerHTML = timestr;
}
if( ls.rows.length == 1 )
{
var tr = ls.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row';
var td = tr.insertCell(-1);
td.colSpan = 4;
td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
}
}
var ls6 = document.getElementById('lease6_status_table');
if (ls6 && info.leases6)
{
ls6.parentNode.style.display = 'block';
/* clear all rows */
while( ls6.rows.length > 1 )
ls6.rows[0].parentNode.deleteRow(1);
for( var i = 0; i < info.leases6.length; i++ )
{
var timestr;
if (info.leases6[i].expires === false)
timestr = '<em><%:unlimited%></em>';
else if (info.leases6[i].expires <= 0)
timestr = '<em><%:expired%></em>';
else
timestr = String.format('%t', info.leases6[i].expires);
var tr = ls6.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
var host = hosts[duid2mac(info.leases6[i].duid)];
if (!info.leases6[i].hostname)
tr.insertCell(-1).innerHTML =
(host && (host.name || host.ipv4 || host.ipv6))
? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">? (%h)</div>'.format(host.name || host.ipv4 || host.ipv6)
: '?';
else
tr.insertCell(-1).innerHTML =
(host && host.name && info.leases6[i].hostname != host.name)
? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">%h (%h)</div>'.format(info.leases6[i].hostname, host.name)
: info.leases6[i].hostname;
tr.insertCell(-1).innerHTML = info.leases6[i].ip6addr;
tr.insertCell(-1).innerHTML = info.leases6[i].duid;
tr.insertCell(-1).innerHTML = timestr;
}
if( ls6.rows.length == 1 )
{
var tr = ls6.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row';
var td = tr.insertCell(-1);
td.colSpan = 4;
td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
}
}
<% end %>
<% if has_wifi then %>
var assoclist = [ ];
var ws = document.getElementById('wifi_status_table');
if (ws)
{
var wsbody = ws.rows[0].parentNode;
while (ws.rows.length > 0)
wsbody.deleteRow(0);
for (var didx = 0; didx < info.wifinets.length; didx++)
{
var dev = info.wifinets[didx];
var tr = wsbody.insertRow(-1);
var td;
td = tr.insertCell(-1);
td.width = "33%";
td.innerHTML = dev.name;
td.style.verticalAlign = "top";
td = tr.insertCell(-1);
var s = '';
for (var nidx = 0; nidx < dev.networks.length; nidx++)
{
var net = dev.networks[nidx];
var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled);
var icon;
if (!is_assoc)
icon = "<%=resource%>/icons/signal-none.png";
else if (net.quality == 0)
icon = "<%=resource%>/icons/signal-0.png";
else if (net.quality < 25)
icon = "<%=resource%>/icons/signal-0-25.png";
else if (net.quality < 50)
icon = "<%=resource%>/icons/signal-25-50.png";
else if (net.quality < 75)
icon = "<%=resource%>/icons/signal-50-75.png";
else
icon = "<%=resource%>/icons/signal-75-100.png";
s += String.format(
'<table><tr><td style="text-align:center; width:32px; padding:3px">' +
'<img src="%s" title="<%:Signal%>: %d dBm / <%:Noise%>: %d dBm" />' +
'<br /><small>%d%%</small>' +
'</td><td style="text-align:left; padding:3px"><small>' +
'<strong><%:SSID%>:</strong> <a href="%s">%h</a><br />' +
'<strong><%:Mode%>:</strong> %s<br />' +
'<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>)<br />' +
'<strong><%:Bitrate%>:</strong> %s <%:Mbit/s%><br />',
icon, net.signal, net.noise,
net.quality,
net.link, net.ssid || '?',
net.mode,
net.channel, net.frequency,
net.bitrate || '?'
);
if (is_assoc)
{
s += String.format(
'<strong><%:BSSID%>:</strong> %s<br />' +
'<strong><%:Encryption%>:</strong> %s',
net.bssid || '?',
net.encryption
);
}
else
{
s += '<em><%:Wireless is disabled or not associated%></em>';
}
s += '</small></td></tr></table>';
for (var bssid in net.assoclist)
{
var bss = net.assoclist[bssid];
bss.bssid = bssid;
bss.link = net.link;
bss.name = net.name;
bss.ifname = net.ifname;
bss.radio = dev.name;
assoclist.push(bss);
}
}
if (!s)
s = '<em><%:No information available%></em>';
td.innerHTML = s;
}
}
var ac = document.getElementById('wifi_assoc_table');
if (ac)
{
/* clear all rows */
while( ac.rows.length > 1 )
ac.rows[0].parentNode.deleteRow(1);
assoclist.sort(function(a, b) {
return (a.name == b.name)
? (a.bssid < b.bssid)
: (a.name > b.name )
;
});
for( var i = 0; i < assoclist.length; i++ )
{
var tr = ac.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + (1 + (i % 2));
var icon;
var q = (-1 * (assoclist[i].noise - assoclist[i].signal)) / 5;
if (q < 1)
icon = "<%=resource%>/icons/signal-0.png";
else if (q < 2)
icon = "<%=resource%>/icons/signal-0-25.png";
else if (q < 3)
icon = "<%=resource%>/icons/signal-25-50.png";
else if (q < 4)
icon = "<%=resource%>/icons/signal-50-75.png";
else
icon = "<%=resource%>/icons/signal-75-100.png";
tr.insertCell(-1).innerHTML = String.format(
'<span class="ifacebadge" title="%q"><img src="<%=resource%>/icons/wifi.png" /> %h</span>',
assoclist[i].radio, assoclist[i].ifname
);
tr.insertCell(-1).innerHTML = String.format(
'<a href="%s">%s</a>',
assoclist[i].link,
'%h'.format(assoclist[i].name).nobr()
);
tr.insertCell(-1).innerHTML = assoclist[i].bssid;
var host = hosts[assoclist[i].bssid];
if (host)
tr.insertCell(-1).innerHTML = String.format(
'<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis">%s</div>',
((host.name && (host.ipv4 || host.ipv6))
? '%h (%s)'.format(host.name, host.ipv4 || host.ipv6)
: '%h'.format(host.name || host.ipv4 || host.ipv6)).nobr()
);
else
tr.insertCell(-1).innerHTML = '?';
tr.insertCell(-1).innerHTML = String.format(
'<span class="ifacebadge" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%> / <%:SNR%>: %d"><img src="%s" /> %d / %d <%:dBm%></span>',
assoclist[i].signal, assoclist[i].noise, assoclist[i].signal - assoclist[i].noise,
icon,
assoclist[i].signal, assoclist[i].noise
);
tr.insertCell(-1).innerHTML = wifirate(assoclist[i], true).nobr() + '<br />' + wifirate(assoclist[i], false).nobr();
}
if (ac.rows.length == 1)
{
var tr = ac.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row';
var td = tr.insertCell(-1);
td.colSpan = 7;
td.innerHTML = '<br /><em><%:No information available%></em>';
}
}
<% end %>
var e;
if (e = document.getElementById('localtime'))
e.innerHTML = info.localtime;
if (e = document.getElementById('uptime'))
e.innerHTML = String.format('%t', info.uptime);
if (e = document.getElementById('loadavg'))
e.innerHTML = String.format(
'%.02f, %.02f, %.02f',
info.loadavg[0] / 65535.0,
info.loadavg[1] / 65535.0,
info.loadavg[2] / 65535.0
);
if (e = document.getElementById('memtotal'))
e.innerHTML = progressbar(
Math.floor((info.memory.free + info.memory.buffered) / 1048576) + " <%:MB%>",
Math.floor(info.memory.total / 1048576) + " <%:MB%>"
);
if (e = document.getElementById('memfree'))
e.innerHTML = progressbar(
Math.floor(info.memory.free / 1048576) + " <%:MB%>",
Math.floor(info.memory.total / 1048576) + " <%:MB%>"
);
if (e = document.getElementById('membuff'))
e.innerHTML = progressbar(
Math.floor(info.memory.buffered / 1048576) + " <%:MB%>",
Math.floor(info.memory.total / 1048576) + " <%:MB%>"
);
if (e = document.getElementById('swaptotal'))
e.innerHTML = progressbar(
Math.floor(info.swap.free / 1048576) + " <%:MB%>",
Math.floor(info.swap.total / 1048576) + " <%:MB%>"
);
if (e = document.getElementById('swapfree'))
e.innerHTML = progressbar(
Math.floor(info.swap.free / 1048576) + " <%:MB%>",
Math.floor(info.swap.total / 1048576) + " <%:MB%>"
);
if (e = document.getElementById('conns'))
e.innerHTML = progressbar(info.conncount, info.connmax);
}
);
//]]></script>
<h2 name="content"><%:Status%></h2>
<fieldset class="cbi-section">
<legend><%:System%></legend>
<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
<tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or boardinfo.system or "?")%></td></tr>
<tr><td width="33%"><%:CPU Temperature%></td><td><%=luci.sys.exec("sensors | grep 'Core 0' | cut -c10-24")%> @ <%=luci.sys.exec("grep 'MHz' /proc/cpuinfo | cut -c11- |sed -n '1p'")%> MHz</td></tr>
<tr><td width="33%"><%:Firmware Version%></td><td>
<%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> /
<%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>)
</td></tr>
<tr><td width="33%"><%:Kernel Version%></td><td><%=unameinfo.release or "?"%></td></tr>
<tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
<tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr>
<tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<legend><%:Memory%></legend>
<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Total Available%></td><td id="memtotal">-</td></tr>
<tr><td width="33%"><%:Free%></td><td id="memfree">-</td></tr>
<tr><td width="33%"><%:Buffered%></td><td id="membuff">-</td></tr>
</table>
</fieldset>
<% if swapinfo.total > 0 then %>
<fieldset class="cbi-section">
<legend><%:Swap%></legend>
<table width="100%" cellspacing="10">
<tr><td width="33%"><%:Total Available%></td><td id="swaptotal">-</td></tr>
<tr><td width="33%"><%:Free%></td><td id="swapfree">-</td></tr>
</table>
</fieldset>
<% end %>
<fieldset class="cbi-section">
<legend><%:Network%></legend>
<table width="100%" cellspacing="10">
<tr><td width="33%" style="vertical-align:top"><%:IPv4 WAN Status%></td><td>
<table><tr>
<td id="wan4_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td>
<td id="wan4_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td>
</tr></table>
</td></tr>
<% if has_ipv6 then %>
<tr><td width="33%" style="vertical-align:top"><%:IPv6 WAN Status%></td><td>
<table><tr>
<td id="wan6_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td>
<td id="wan6_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td>
</tr></table>
</td></tr>
<% end %>
<tr><td width="33%"><%:Active Connections%></td><td id="conns">-</td></tr>
</table>
</fieldset>
<% if has_dhcp then %>
<fieldset class="cbi-section">
<legend><%:DHCP Leases%></legend>
<table class="cbi-section-table" id="lease_status_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Hostname%></th>
<th class="cbi-section-table-cell"><%:IPv4-Address%></th>
<th class="cbi-section-table-cell"><%:MAC-Address%></th>
<th class="cbi-section-table-cell"><%:Leasetime remaining%></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="4"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
<% if has_ipv6 then %>
<fieldset class="cbi-section" style="display:none">
<legend><%:DHCPv6 Leases%></legend>
<table class="cbi-section-table" id="lease6_status_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:Host%></th>
<th class="cbi-section-table-cell"><%:IPv6-Address%></th>
<th class="cbi-section-table-cell"><%:DUID%></th>
<th class="cbi-section-table-cell"><%:Leasetime remaining%></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="4"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
<% end %>
<% end %>
<% if has_dsl then %>
<fieldset class="cbi-section">
<legend><%:DSL%></legend>
<table width="100%" cellspacing="10">
<tr><td width="33%" style="vertical-align:top"><%:DSL Status%></td><td>
<table><tr>
<td id="dsl_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td>
<td id="dsl_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td>
</tr></table>
</td></tr>
</table>
</fieldset>
<% end %>
<% if has_wifi then %>
<fieldset class="cbi-section">
<legend><%:Wireless%></legend>
<table id="wifi_status_table" width="100%" cellspacing="10">
<tr><td><em><%:Collecting data...%></em></td></tr>
</table>
</fieldset>
<fieldset class="cbi-section">
<legend><%:Associated Stations%></legend>
<table class="cbi-section-table valign-middle" id="wifi_assoc_table">
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell">&#160;</th>
<th class="cbi-section-table-cell"><%:Network%></th>
<th class="cbi-section-table-cell"><%:MAC-Address%></th>
<th class="cbi-section-table-cell"><%:Host%></th>
<th class="cbi-section-table-cell"><%:Signal%> / <%:Noise%></th>
<th class="cbi-section-table-cell"><%:RX Rate%> / <%:TX Rate%></th>
</tr>
<tr class="cbi-section-table-row">
<td colspan="6"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
<% end %>
<%-
local incdir = util.libpath() .. "/view/admin_status/index/"
if fs.access(incdir) then
local inc
for inc in fs.dir(incdir) do
if inc:match("%.htm$") then
include("admin_status/index/" .. inc:gsub("%.htm$", ""))
end
end
end
-%>
<%+footer%>

36
lean/automount/Makefile Normal file
View File

@ -0,0 +1,36 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=automount
PKG_VERSION:=1
PKG_RELEASE:=20
PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/automount
TITLE:=Mount autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-vfat +ntfs-3g +kmod-fs-ext4
endef
define Package/automount/description
A usb autoconfig hotplug script.
endef
define Build/Compile
endef
define Package/automount/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/15-automount $(1)/etc/15-automount
$(INSTALL_BIN) ./files/zzz-move-automount $(1)/etc/uci-defaults/zzz-move-automount
endef
$(eval $(call BuildPackage,automount))

View File

@ -0,0 +1,27 @@
#!/bin/sh
# Copyright (C) 2015 OpenWrt.org
# 0 yes blockdevice handles this - 1 no it is not there
blkdev=`dirname $DEVPATH`
basename=`basename $blkdev`
device=`basename $DEVPATH`
skip=`block info | sed 's/\(.*\): .*/\1/' | grep -q $device ; echo $?`
path=$DEVPATH
if [ $basename != "block" ] && [ -z "${device##sd*}" ] && [ $skip -eq 1 ]; then
mntpnt=$device
case "$ACTION" in
add)
mkdir -p /mnt/$mntpnt
chmod 777 /mnt/$mntpnt
# Try to be gentle on solid state devices
mount -o rw,noatime,discard /dev/$device /mnt/$mntpnt
;;
remove)
# Once the device is removed, the /dev entry disappear. We need mountpoint
mountpoint=`mount |grep /dev/$device | sed 's/.* on \(.*\) type.*/\1/'`
umount -l $mountpoint
;;
esac
fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
sleep 15
mv /etc/15-automount /etc/hotplug.d/block/

35
lean/autosamba/Makefile Normal file
View File

@ -0,0 +1,35 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autosamba
PKG_VERSION:=1
PKG_RELEASE:=9
PKG_ARCH:=all
include $(INCLUDE_DIR)/package.mk
define Package/autosamba
TITLE:=Samba autoconfig hotplug script.
MAINTAINER:=Lean
DEPENDS:=+luci-app-samba
endef
define Package/autosamba/description
A hotplug script to config Samba share automatically.
endef
define Build/Compile
endef
define Package/autosamba/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/20-smb $(1)/etc/hotplug.d/block/20-smb
endef
$(eval $(call BuildPackage,autosamba))

105
lean/autosamba/files/20-smb Executable file
View File

@ -0,0 +1,105 @@
#!/bin/sh
#
# D-Team Technology Co.,Ltd. ShenZhen
# 作者:Vic
#
#
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#
. /lib/functions.sh
. /lib/functions/service.sh
global=0
config_file="/etc/config/samba"
wait_for_init() {
for i in `seq 30`
do
[ -e /tmp/procd.done ] || {
sleep 1; continue;
}
return
done
}
smb_handle() {
config_get path $1 path
if [ "$path" = "$2" ] ;then
global=1
fi
}
chk_en() {
config_get_bool autoshare $1 autoshare 1
[ $autoshare -eq 0 ] && exit
}
config_load samba
config_foreach chk_en samba
device=`basename $DEVPATH`
case "$ACTION" in
add)
case "$device" in
sd*) ;;
md*) ;;
hd*);;
mmcblk*);;
*) return;;
esac
path="/dev/$device"
wait_for_init
cat /proc/mounts | while read j
do
str=${j%% *}
if [ "$str" == $path ];then
strr=${j#* }
target=${strr%% *}
global=0
config_foreach smb_handle sambashare $target
name=${target#*/mnt/}
if [ $global -eq 0 ] ;then
echo -e "\n\nconfig sambashare" >> $config_file
echo -e "\toption auto '1'" >> $config_file
echo -e "\toption name '$name'" >> $config_file
echo -e "\toption path '$target'" >> $config_file
echo -e "\toption read_only 'no'" >> $config_file
echo -e "\toption guest_ok 'yes'" >> $config_file
echo -e "\toption create_mask '0666'" >> $config_file
echo -e "\toption dir_mask '0777'" >> $config_file
echo -e "\toption device '$device'" >> $config_file
/etc/init.d/samba reload
return
fi
fi
done
;;
remove)
i=0
while true
do
dev=`uci get samba.@sambashare[$i].device`
[ $? -ne 0 ] && break
[ "$dev" = "$device" ] && {
auto=`uci get samba.@sambashare[$i].auto`
[ $auto = "1" ] && {
mount_dir=`uci get samba.@sambashare[$i].name`
rm -rf /mnt/$device /mnt/$mount_dir
uci delete samba.@sambashare[$i]
uci commit
/etc/init.d/samba reload
return
}
}
let i+=1
done
;;
esac

View File

@ -0,0 +1,72 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ddns-scripts_aliyun
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Sense <sensec@gmail.com>
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=DDNS extension for AliYun.com
PKGARCH:=all
DEPENDS:=+ddns-scripts +wget +openssl-util
endef
define Package/$(PKG_NAME)/description
Dynamic DNS Client scripts extension for AliYun.com
endef
define Build/Configure
endef
define Build/Compile
$(CP) ./*.sh $(PKG_BUILD_DIR)
endef
define Package/$(PKG_NAME)/preinst
#!/bin/sh
# if NOT run buildroot then stop service
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
exit 0 # suppress errors
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/ddns
$(INSTALL_BIN) $(PKG_BUILD_DIR)/update_aliyun_com.sh $(1)/usr/lib/ddns
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
# remove old services file entries
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
# and create new
printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
# on real system restart service if enabled
[ -z "$${IPKG_INSTROOT}" ] && {
/etc/init.d/ddns enabled && \
/etc/init.d/ddns start >/dev/null 2>&1
}
exit 0 # suppress errors
endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
# if NOT run buildroot then stop service
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
# remove services file entries
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
exit 0 # suppress errors
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,233 @@
#!/bin/sh
#
# 用于阿里云解析的DNS更新脚本
# 2017-2018 Sense <sensec at gmail dot com>
# 阿里云解析API文档 https://help.aliyun.com/document_detail/29739.html
#
# 本脚本由 dynamic_dns_functions.sh 内的函数 send_update() 调用
#
# 需要在 /etc/config/ddns 中设置的选项
# option username - 阿里云API访问账号 Access Key ID。可通过 aliyun.com 帐号管理的 accesskeys 获取, 或者访问 https://ak-console.aliyun.com
# option password - 阿里云API访问密钥 Access Key Secret
# option domain - 完整的域名。建议主机与域名之间使用 @符号 分隔,否则将以第一个 .符号 之前的内容作为主机名
#
# 检查传入参数
[ -z "$username" ] && write_log 14 "配置错误保存阿里云API访问账号的'用户名'不能为空"
[ -z "$password" ] && write_log 14 "配置错误保存阿里云API访问密钥的'密码'不能为空"
# 检查外部调用工具
[ -n "$WGET_SSL" ] || write_log 13 "使用阿里云API需要 GNU Wget 支持,请先安装"
command -v sed >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 sed 支持,请先安装"
command -v openssl >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 openssl-util 支持,请先安装"
# 包含用于解析 JSON 格式返回值的函数
. /usr/share/libubox/jshn.sh
# 变量声明
local __HOST __DOMAIN __TYPE __URLBASE __CMDBASE __URLARGS __SEPARATOR __RECID
[ $use_https -eq 0 ] && __URLBASE="http://alidns.aliyuncs.com/" || __URLBASE="https://alidns.aliyuncs.com/"
__SEPARATOR="&"
# 从 $domain 分离主机和域名
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
__HOST="${domain%%@*}"
__DOMAIN="${domain#*@}"
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
# 设置记录类型
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
# 构造基本通信命令
build_command() {
__CMDBASE="$WGET_SSL -nv -t 1 -O $DATFILE -o $ERRFILE"
# 绑定用于通信的主机/IP
if [ -n "$bind_network" ]; then
local bind_ip run_prog
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
eval "$run_prog bind_ip $bind_network" || \
write_log 13 "无法使用 '$run_prog $bind_network' 获取本地IP地址 - 错误代码: '$?'"
write_log 7 "强制使用IP '$bind_ip' 通信"
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
fi
# 强制设定IP版本
if [ $force_ipversion -eq 1 ]; then
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
fi
# 设置CA证书参数
if [ $use_https -eq 1 ]; then
if [ "$cacert" = "IGNORE" ]; then
__CMDBASE="$__CMDBASE --no-check-certificate"
elif [ -f "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
elif [ -d "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
elif [ -n "$cacert" ]; then
write_log 14 "在 '$cacert' 中未找到用于 HTTPS 通信的有效证书"
fi
fi
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
}
# 用于阿里云API的通信函数
aliyun_transfer() {
local __PARAM=$*
local __CNT=0
local __RUNPROG __ERR PID_SLEEP
[ $# -eq 0 ] && write_log 12 "'aliyun_transfer()' 出错 - 参数数量错误"
while : ; do
build_Request $__PARAM
__RUNPROG="$__CMDBASE '${__URLBASE}?${__URLARGS}'"
write_log 7 "#> $__RUNPROG"
eval $__RUNPROG
__ERR=$?
[ $__ERR -eq 0 ] && return 0
write_log 3 "wget 错误代码: '$__ERR'"
write_log 7 "$(cat $ERRFILE)"
if [ $VERBOSE -gt 1 ]; then
write_log 4 "传输失败 - 详细模式: $VERBOSE - 出错后不再重试"
return 1
fi
__CNT=$(( $__CNT + 1 ))
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
write_log 14 "$retry_count 次重试后传输还是失败"
write_log 4 "传输失败 - $__CNT/$retry_count$RETRY_SECONDS 秒后重试"
sleep $RETRY_SECONDS &
PID_SLEEP=$!
wait $PID_SLEEP
PID_SLEEP=0
done
}
# 百分号编码
percentEncode() {
if [ -z "${1//[A-Za-z0-9_.~-]/}" ]; then
echo -n "$1"
else
local string=$1; local i=0; local ret chr
while [ $i -lt ${#string} ]; do
chr=${string:$i:1}
[ -z "${chr#[^A-Za-z0-9_.~-]}" ] && chr=$(printf '%%%02X' "'$chr")
ret="$ret$chr"
i=$(( $i + 1 ))
done
echo -n "$ret"
fi
}
# 构造阿里云解析请求参数
build_Request() {
local args=$*; local string
local HTTP_METHOD="GET"
# 添加请求参数
__URLARGS=
for string in $args; do
case "${string%%=*}" in
Format|Version|AccessKeyId|SignatureMethod|Timestamp|SignatureVersion|SignatureNonce|Signature) ;; # 过滤公共参数
*) __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}");;
esac
done
__URLARGS="${__URLARGS:1}"
# 附加公共参数
string="Format=JSON"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="Version=2015-01-09"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="AccessKeyId=$username"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="SignatureMethod=HMAC-SHA1"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="Timestamp="$(date -u '+%Y-%m-%dT%H:%M:%SZ'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="SignatureVersion=1.0"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="SignatureNonce="$(cat '/proc/sys/kernel/random/uuid'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
# 对请求参数进行排序,用于生成签名
string=$(echo -n "$__URLARGS" | sed 's/\'"${__SEPARATOR}"'/\n/g' | sort | sed ':label; N; s/\n/\'"${__SEPARATOR}"'/g; b label')
# 构造用于计算签名的字符串
string="${HTTP_METHOD}${__SEPARATOR}"$(percentEncode "/")"${__SEPARATOR}"$(percentEncode "$string")
# 字符串计算签名HMAC值
local signature=$(echo -n "$string" | openssl dgst -sha1 -hmac "${password}&" -binary)
# HMAC值编码成字符串得到签名值
signature=$(echo -n "$signature" | openssl base64)
# 附加签名参数
string="Signature=$signature"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
}
# 添加解析记录
add_domain() {
local value
aliyun_transfer "Action=AddDomainRecord" "DomainName=${__DOMAIN}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var value "RecordId"
[ -z "$value" ] && write_log 14 "添加新解析记录失败"
write_log 7 "添加新解析记录成功"
return 0
}
# 修改解析记录
update_domain() {
local value
aliyun_transfer "Action=UpdateDomainRecord" "RecordId=${__RECID}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var value "RecordId"
[ -z "$value" ] && write_log 14 "修改解析记录失败"
write_log 7 "修改解析记录成功"
return 0
}
# 启用解析记录
enable_domain() {
local value
aliyun_transfer "Action=SetDomainRecordStatus" "RecordId=${__RECID}" "Status=Enable" || write_log 14 "服务器通信失败"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var value "Status"
[ "$value" != "Enable" ] && write_log 14 "启用解析记录失败"
write_log 7 "启用解析记录成功"
return 0
}
# 获取子域名解析记录列表
describe_domain() {
local value type; local ret=0
aliyun_transfer "Action=DescribeSubDomainRecords" "SubDomain=${__HOST}.${__DOMAIN}" || write_log 14 "服务器通信失败"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var value "TotalCount"
if [ $value -eq 0 ]; then
write_log 7 "解析记录不存在"
ret=1
else
json_select "DomainRecords" >/dev/null 2>&1
json_select "Record" >/dev/null 2>&1
json_select 1 >/dev/null 2>&1
json_get_var value "Locked"
[ $value -ne 0 ] && write_log 14 "解析记录被锁定"
json_get_var __RECID "RecordId"
write_log 7 "获得解析记录ID: ${__RECID}"
json_get_var value "Status"
[ "$value" != "ENABLE" ] && ret=$(( $ret | 2 )) && write_log 7 "解析记录被禁用"
json_get_var type "Type"
json_get_var value "Value"
[ "$type" != "${__TYPE}" -o "$value" != "${__IP}" ] && ret=$(( $ret | 4 )) && write_log 7 "地址或类型需要修改"
fi
return $ret
}
build_command
describe_domain
ret=$?
if [ $ret -eq 1 ]; then
sleep 3 && add_domain
else
[ $(( $ret & 2 )) -ne 0 ] && sleep 3 && enable_domain
[ $(( $ret & 4 )) -ne 0 ] && sleep 3 && update_domain
fi
return 0

View File

@ -0,0 +1,49 @@
#
# Copyright (C) 2016-2017 GitHub
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=default-settings
PKG_VERSION:=1.0
PKG_RELEASE:=63
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/default-settings
SECTION:=luci
CATEGORY:=LuCI
TITLE:=LuCI support for Default Settings
PKGARCH:=all
DEPENDS:=+@LUCI_LANG_zh-cn
endef
define Package/default-settings/description
Language Support Packages.
endef
define Build/Prepare
$(foreach po,$(wildcard ${CURDIR}/i18n/*.po), \
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/default-settings/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.lmo $(1)/usr/lib/lua/luci/i18n/
$(INSTALL_BIN) ./files/zzz-default-settings $(1)/etc/uci-defaults/99-default-settings
endef
$(eval $(call BuildPackage,default-settings))

View File

@ -0,0 +1,72 @@
#!/bin/sh
uci set luci.main.lang=zh_cn
uci commit luci
uci set system.@system[0].timezone=CST-8
uci set system.@system[0].zonename=Asia/Shanghai
uci commit system
uci set fstab.@global[0].anon_mount=1
uci commit fstab
rm -f /usr/lib/lua/luci/view/admin_status/index/mwan.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/upnp.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/ddns.htm
rm -f /usr/lib/lua/luci/view/admin_status/index/minidlna.htm
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/aria2.lua
sed -i 's/services/nas/g' /usr/lib/lua/luci/view/aria2/overview_status.htm
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/hd_idle.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/samba.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/minidlna.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/transmission.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/mjpg-streamer.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/p910nd.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/usb_printer.lua
sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/xunlei.lua
sed -i 's/services/nas/g' /usr/lib/lua/luci/view/minidlna_status.htm
uci set minidlna.config.enabled=0
uci commit minidlna
/etc/init.d/minidlna stop
ln -sf /sbin/ip /usr/bin/ip
sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf
sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow
sed -i "s/# //g" /etc/opkg/distfeeds.conf
uci set dhcp.lan.ra='server'
uci set dhcp.lan.dhcpv6='server'
uci set dhcp.lan.ra_management='1'
uci set dhcp.lan.ra_default='1'
uci commit dhcp
uci set upnpd.config.enabled='1'
uci set upnpd.config.igdv1='1'
uci commit upnpd
sed -i '/REDIRECT --to-ports 53/d' /etc/firewall.user
echo "iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53" >> /etc/firewall.user
echo "iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53" >> /etc/firewall.user
sed -i '/option disabled/d' /etc/config/wireless
sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh
wifi up
sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release
echo "DISTRIB_REVISION='R8.1.8 By Lean'" >> /etc/openwrt_release
sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release
echo "DISTRIB_DESCRIPTION='OpenWrt '" >> /etc/openwrt_release
sed -i 's/cbi.submit\"] = true/cbi.submit\"] = \"1\"/g' /usr/lib/lua/luci/dispatcher.lua
rm -rf /tmp/luci-modulecache/
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,53 @@
msgid "Processor"
msgstr "处理器"
msgid "Architecture"
msgstr "架构"
msgid "CPU Temperature"
msgstr "CPU温度"
msgid "CPU Info"
msgstr "CPU信息"
msgid "CPU Model"
msgstr "处理器型号"
msgid "CPU frequency"
msgstr "CPU频率"
msgid "RAM frequency"
msgstr "RAM频率"
msgid "Flash Size"
msgstr "闪存大小"
msgid "Free Memory"
msgstr "释放内存"
msgid "RUNNING"
msgstr "运行中"
msgid "NOT RUNNING"
msgstr "未运行"
msgid "ZRam Settings"
msgstr "ZRam 设置"
msgid "ZRam Compression Algorithm"
msgstr "ZRAM压缩算法"
msgid "ZRam Compression Streams"
msgstr "ZRam 压缩数据流线程数"
msgid "ZRam Size"
msgstr "ZRam 大小"
msgid "Size of the ZRam device in megabytes"
msgstr "划分给ZRam 分区的内存大小MB推荐留空由系统自动管理"
msgid "Number of parallel threads used for compression"
msgstr "用于压缩内存数据的CPU并发线程数"
msgid "Swap"
msgstr "虚拟内存"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,203 @@
msgid ""
msgstr ""
"Project-Id-Version: luci-i18n-sqm\n"
"POT-Creation-Date: 2017-03-28 04:14+0800\n"
"PO-Revision-Date: 2017-03-28 04:15+0800\n"
"Last-Translator: \n"
"Language-Team: player131 <player1311@gmail.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.10\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-SearchPath-0: .\n"
#: usr/lib/lua/luci/controller/sqm.lua:24
msgid "SQM QoS"
msgstr "SQM QoS"
#: usr/lib/lua/luci/model/cbi/sqm.lua:25
msgid "Smart Queue Management"
msgstr "智能队列管理"
#: usr/lib/lua/luci/model/cbi/sqm.lua:26
msgid ""
"With <abbr title=\"Smart Queue Management\">SQM</abbr> you can enable "
"traffic shaping, better mixing (Fair Queueing), active queue length "
"management (AQM) and prioritisation on one network interface."
msgstr ""
"使用 <abbr title=\"智能列队管理\">SQM</abbr> 你可以启用流量整形,更好的混合"
"(公平列队)主动列队管理(AQM) 并设置网络接口优先级。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:32
msgid "Queues"
msgstr "队列"
#: usr/lib/lua/luci/model/cbi/sqm.lua:33
msgid "Basic Settings"
msgstr "基本设置"
#: usr/lib/lua/luci/model/cbi/sqm.lua:34
msgid "Queue Discipline"
msgstr "列队规则"
#: usr/lib/lua/luci/model/cbi/sqm.lua:35
msgid "Link Layer Adaptation"
msgstr "链路层适配"
#: usr/lib/lua/luci/model/cbi/sqm.lua:40
msgid "Enable this SQM instance."
msgstr "启用此SQM实例"
#: usr/lib/lua/luci/model/cbi/sqm.lua:54
msgid ""
"The SQM GUI has just enabled the sqm initscript on your behalf. Remember to "
"disable the sqm initscript manually under System Startup menu in case this "
"change was not wished for."
msgstr ""
"你刚刚开启了SQM随机启动功能如果你不希望SQM随机启动可以在系统启动菜单下手"
"动禁用。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:60
msgid "Interface name"
msgstr "接口名称"
#: usr/lib/lua/luci/model/cbi/sqm.lua:70
msgid ""
"Download speed (kbit/s) (ingress) set to 0 to selectively disable ingress "
"shaping:"
msgstr "下载速度(kbit/s)(入口)<br />设置为0关闭入口控制"
#: usr/lib/lua/luci/model/cbi/sqm.lua:74
msgid ""
"Upload speed (kbit/s) (egress) set to 0 to selectively disable egress "
"shaping:"
msgstr "上传速度(kbit/s)(出口)<br />设置为0关闭出口控制"
#: usr/lib/lua/luci/model/cbi/sqm.lua:78
msgid ""
"Create log file for this SQM instance under /var/run/sqm/${Inerface_name}."
"debug.log. Make sure to delete log files manually."
msgstr ""
"创建日志文件到/var/run/sqm/<br />${Inerface_name}.debug.log。<br />请务必手动"
"删除日志文件。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:82
msgid "Verbosity of SQM's output into the system log."
msgstr "SQM输出到系统日志的详细程度。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:86 usr/lib/lua/luci/model/cbi/sqm.lua:99
#: usr/lib/lua/luci/model/cbi/sqm.lua:148
#: usr/lib/lua/luci/model/cbi/sqm.lua:155
#: usr/lib/lua/luci/model/cbi/sqm.lua:202
#: usr/lib/lua/luci/model/cbi/sqm.lua:243
msgid "default"
msgstr "默认"
#: usr/lib/lua/luci/model/cbi/sqm.lua:98
msgid ""
"Queuing disciplines useable on this system. After installing a new qdisc, "
"you need to restart the router to see updates!"
msgstr "系统上可用的列队规则。安装新的队列规则后,重新启动路由器才会看到更新!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:112
msgid "Queue setup script"
msgstr "队列脚本设置"
#: usr/lib/lua/luci/model/cbi/sqm.lua:129
msgid ""
"Show and Use Advanced Configuration. Advanced options will only be used as "
"long as this box is checked."
msgstr "选中该复选框显示高级配置。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:133
msgid "Squash DSCP on inbound packets (ingress):"
msgstr "入站数据包压缩DSCP:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:140
msgid "Ignore DSCP on ingress:"
msgstr "忽略入站DSCP"
#: usr/lib/lua/luci/model/cbi/sqm.lua:147
msgid ""
"Explicit congestion notification (ECN) status on inbound packets (ingress):"
msgstr "入站数据包的显式拥塞通知ECN状态"
#: usr/lib/lua/luci/model/cbi/sqm.lua:154
msgid ""
"Explicit congestion notification (ECN) status on outbound packets (egress)."
msgstr "出站数据包的显式拥塞通知ECN状态"
#: usr/lib/lua/luci/model/cbi/sqm.lua:161
msgid ""
"Show and Use Dangerous Configuration. Dangerous options will only be used as "
"long as this box is checked."
msgstr "选中该复选框显示危险配置。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:166
msgid "Hard limit on ingress queues; leave empty for default."
msgstr "入站队列严格限制;留空为默认。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:173
msgid "Hard limit on egress queues; leave empty for default."
msgstr "出站队列严格限制;留空为默认。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:180
msgid "Latency target for ingress, e.g 5ms [units: s, ms, or us]; leave empty for automatic selection, put in the word default for the qdisc's default."
msgstr "入站延迟目标,例如 5ms [单位: s, ms, 或 us]留空为自动选择default为列队规则默认值。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:185
msgid "Latency target for egress, e.g. 5ms [units: s, ms, or us]; leave empty for automatic selection, put in the word default for the qdisc's default."
msgstr "出站延迟目标,例如 5ms [单位: s, ms, 或 us]留空为自动选择default为列队规则默认值。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:192
msgid ""
"Advanced option string to pass to the ingress queueing disciplines; no error "
"checking, use very carefully."
msgstr "传递到入站队列规则的高级选项字符串;没有错误检查。请谨慎使用!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:196
msgid ""
"Advanced option string to pass to the egress queueing disciplines; no error "
"checking, use very carefully."
msgstr "传递到出站队列规则的高级选项字符串;没有错误检查。请谨慎使用!"
#: usr/lib/lua/luci/model/cbi/sqm.lua:201
msgid "Which link layer to account for:"
msgstr "对哪个链路层生效:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:207
msgid "Per Packet Overhead (byte):"
msgstr "每个数据包开销"
#: usr/lib/lua/luci/model/cbi/sqm.lua:216
msgid ""
"Show Advanced Linklayer Options, (only needed if MTU > 1500). Advanced "
"options will only be used as long as this box is checked."
msgstr ""
"显示高级链路选项仅在MTU> 1500时才需要。 只有选中此框时,才会使用高级选"
"项。"
#: usr/lib/lua/luci/model/cbi/sqm.lua:221
msgid ""
"Maximal Size for size and rate calculations, tcMTU (byte); needs to be >= "
"interface MTU + overhead:"
msgstr "大小和速率计算的最大尺寸tcMTUbyte; 需要> =接口MTU +开销:"
#: usr/lib/lua/luci/model/cbi/sqm.lua:228
msgid ""
"Number of entries in size/rate tables, TSIZE; for ATM choose TSIZE = (tcMTU "
"+ 1) / 16:"
msgstr "大小/速率表中的条目数TSIZE; 对于ATM选择TSIZE =tcMTU + 1/ 16"
#: usr/lib/lua/luci/model/cbi/sqm.lua:235
msgid ""
"Minimal packet size, MPU (byte); needs to be > 0 for ethernet size tables:"
msgstr "最小数据包大小MPUbyte; 在以太网中需要>0"
#: usr/lib/lua/luci/model/cbi/sqm.lua:242
msgid "Which linklayer adaptation mechanism to use; for testing only"
msgstr "使用哪个链路适应机制; 仅用于测试"

View File

@ -0,0 +1,12 @@
INSTALL = install
PREFIX = /usr/bin
po2lmo: src/po2lmo.o src/template_lmo.o
$(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o
install:
$(INSTALL) -m 755 src/po2lmo $(PREFIX)
clean:
$(RM) src/po2lmo src/*.o

Binary file not shown.

View File

@ -0,0 +1,247 @@
/*
* lmo - Lua Machine Objects - PO to LMO conversion tool
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
static void die(const char *msg)
{
fprintf(stderr, "Error: %s\n", msg);
exit(1);
}
static void usage(const char *name)
{
fprintf(stderr, "Usage: %s input.po output.lmo\n", name);
exit(1);
}
static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
if( fwrite(ptr, size, nmemb, stream) == 0 )
die("Failed to write stdout");
}
static int extract_string(const char *src, char *dest, int len)
{
int pos = 0;
int esc = 0;
int off = -1;
for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ )
{
if( (off == -1) && (src[pos] == '"') )
{
off = pos + 1;
}
else if( off >= 0 )
{
if( esc == 1 )
{
switch (src[pos])
{
case '"':
case '\\':
off++;
break;
}
dest[pos-off] = src[pos];
esc = 0;
}
else if( src[pos] == '\\' )
{
dest[pos-off] = src[pos];
esc = 1;
}
else if( src[pos] != '"' )
{
dest[pos-off] = src[pos];
}
else
{
dest[pos-off] = '\0';
break;
}
}
}
return (off > -1) ? strlen(dest) : -1;
}
static int cmp_index(const void *a, const void *b)
{
uint32_t x = ((const lmo_entry_t *)a)->key_id;
uint32_t y = ((const lmo_entry_t *)b)->key_id;
if (x < y)
return -1;
else if (x > y)
return 1;
return 0;
}
static void print_uint32(uint32_t x, FILE *out)
{
uint32_t y = htonl(x);
print(&y, sizeof(uint32_t), 1, out);
}
static void print_index(void *array, int n, FILE *out)
{
lmo_entry_t *e;
qsort(array, n, sizeof(*e), cmp_index);
for (e = array; n > 0; n--, e++)
{
print_uint32(e->key_id, out);
print_uint32(e->val_id, out);
print_uint32(e->offset, out);
print_uint32(e->length, out);
}
}
int main(int argc, char *argv[])
{
char line[4096];
char key[4096];
char val[4096];
char tmp[4096];
int state = 0;
int offset = 0;
int length = 0;
int n_entries = 0;
void *array = NULL;
lmo_entry_t *entry = NULL;
uint32_t key_id, val_id;
FILE *in;
FILE *out;
if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) )
usage(argv[0]);
memset(line, 0, sizeof(key));
memset(key, 0, sizeof(val));
memset(val, 0, sizeof(val));
while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) )
{
if( state == 0 && strstr(line, "msgid \"") == line )
{
switch(extract_string(line, key, sizeof(key)))
{
case -1:
die("Syntax error in msgid");
case 0:
state = 1;
break;
default:
state = 2;
}
}
else if( state == 1 || state == 2 )
{
if( strstr(line, "msgstr \"") == line || state == 2 )
{
switch(extract_string(line, val, sizeof(val)))
{
case -1:
state = 4;
break;
default:
state = 3;
}
}
else
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 2;
break;
default:
strcat(key, tmp);
}
}
}
else if( state == 3 )
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 4;
break;
default:
strcat(val, tmp);
}
}
if( state == 4 )
{
if( strlen(key) > 0 && strlen(val) > 0 )
{
key_id = sfh_hash(key, strlen(key));
val_id = sfh_hash(val, strlen(val));
if( key_id != val_id )
{
n_entries++;
array = realloc(array, n_entries * sizeof(lmo_entry_t));
entry = (lmo_entry_t *)array + n_entries - 1;
if (!array)
die("Out of memory");
entry->key_id = key_id;
entry->val_id = val_id;
entry->offset = offset;
entry->length = strlen(val);
length = strlen(val) + ((4 - (strlen(val) % 4)) % 4);
print(val, length, 1, out);
offset += length;
}
}
state = 0;
memset(key, 0, sizeof(key));
memset(val, 0, sizeof(val));
}
memset(line, 0, sizeof(line));
}
print_index(array, n_entries, out);
if( offset > 0 )
{
print_uint32(offset, out);
fsync(fileno(out));
fclose(out);
}
else
{
fclose(out);
unlink(argv[2]);
}
fclose(in);
return(0);
}

Binary file not shown.

View File

@ -0,0 +1,328 @@
/*
* lmo - Lua Machine Objects - Base functions
*
* Copyright (C) 2009-2010 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
/*
* Hash function from http://www.azillionmonkeys.com/qed/hash.html
* Copyright (C) 2004-2008 by Paul Hsieh
*/
uint32_t sfh_hash(const char *data, int len)
{
uint32_t hash = len, tmp;
int rem;
if (len <= 0 || data == NULL) return 0;
rem = len & 3;
len >>= 2;
/* Main loop */
for (;len > 0; len--) {
hash += sfh_get16(data);
tmp = (sfh_get16(data+2) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2*sizeof(uint16_t);
hash += hash >> 11;
}
/* Handle end cases */
switch (rem) {
case 3: hash += sfh_get16(data);
hash ^= hash << 16;
hash ^= data[sizeof(uint16_t)] << 18;
hash += hash >> 11;
break;
case 2: hash += sfh_get16(data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += *data;
hash ^= hash << 10;
hash += hash >> 1;
}
/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
}
uint32_t lmo_canon_hash(const char *str, int len)
{
char res[4096];
char *ptr, prev;
int off;
if (!str || len >= sizeof(res))
return 0;
for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++)
{
if (isspace(*str))
{
if (!isspace(prev))
*ptr++ = ' ';
}
else
{
*ptr++ = *str;
}
}
if ((ptr > res) && isspace(*(ptr-1)))
ptr--;
return sfh_hash(res, ptr - res);
}
lmo_archive_t * lmo_open(const char *file)
{
int in = -1;
uint32_t idx_offset = 0;
struct stat s;
lmo_archive_t *ar = NULL;
if (stat(file, &s) == -1)
goto err;
if ((in = open(file, O_RDONLY)) == -1)
goto err;
if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL)
{
memset(ar, 0, sizeof(*ar));
ar->fd = in;
ar->size = s.st_size;
fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC);
if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED)
goto err;
idx_offset = ntohl(*((const uint32_t *)
(ar->mmap + ar->size - sizeof(uint32_t))));
if (idx_offset >= ar->size)
goto err;
ar->index = (lmo_entry_t *)(ar->mmap + idx_offset);
ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t);
ar->end = ar->mmap + ar->size;
return ar;
}
err:
if (in > -1)
close(in);
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
free(ar);
}
return NULL;
}
void lmo_close(lmo_archive_t *ar)
{
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
close(ar->fd);
free(ar);
ar = NULL;
}
}
lmo_catalog_t *_lmo_catalogs = NULL;
lmo_catalog_t *_lmo_active_catalog = NULL;
int lmo_load_catalog(const char *lang, const char *dir)
{
DIR *dh = NULL;
char pattern[16];
char path[PATH_MAX];
struct dirent *de = NULL;
lmo_archive_t *ar = NULL;
lmo_catalog_t *cat = NULL;
if (!lmo_change_catalog(lang))
return 0;
if (!dir || !(dh = opendir(dir)))
goto err;
if (!(cat = malloc(sizeof(*cat))))
goto err;
memset(cat, 0, sizeof(*cat));
snprintf(cat->lang, sizeof(cat->lang), "%s", lang);
snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang);
while ((de = readdir(dh)) != NULL)
{
if (!fnmatch(pattern, de->d_name, 0))
{
snprintf(path, sizeof(path), "%s/%s", dir, de->d_name);
ar = lmo_open(path);
if (ar)
{
ar->next = cat->archives;
cat->archives = ar;
}
}
}
closedir(dh);
cat->next = _lmo_catalogs;
_lmo_catalogs = cat;
if (!_lmo_active_catalog)
_lmo_active_catalog = cat;
return 0;
err:
if (dh) closedir(dh);
if (cat) free(cat);
return -1;
}
int lmo_change_catalog(const char *lang)
{
lmo_catalog_t *cat;
for (cat = _lmo_catalogs; cat; cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
_lmo_active_catalog = cat;
return 0;
}
}
return -1;
}
static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash)
{
unsigned int m, l, r;
uint32_t k;
l = 0;
r = ar->length - 1;
while (1)
{
m = l + ((r - l) / 2);
if (r < l)
break;
k = ntohl(ar->index[m].key_id);
if (k == hash)
return &ar->index[m];
if (k > hash)
{
if (!m)
break;
r = m - 1;
}
else
{
l = m + 1;
}
}
return NULL;
}
int lmo_translate(const char *key, int keylen, char **out, int *outlen)
{
uint32_t hash;
lmo_entry_t *e;
lmo_archive_t *ar;
if (!key || !_lmo_active_catalog)
return -2;
hash = lmo_canon_hash(key, keylen);
for (ar = _lmo_active_catalog->archives; ar; ar = ar->next)
{
if ((e = lmo_find_entry(ar, hash)) != NULL)
{
*out = ar->mmap + ntohl(e->offset);
*outlen = ntohl(e->length);
return 0;
}
}
return -1;
}
void lmo_close_catalog(const char *lang)
{
lmo_archive_t *ar, *next;
lmo_catalog_t *cat, *prev;
for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
if (prev)
prev->next = cat->next;
else
_lmo_catalogs = cat->next;
for (ar = cat->archives; ar; ar = next)
{
next = ar->next;
lmo_close(ar);
}
free(cat);
break;
}
}
}

View File

@ -0,0 +1,92 @@
/*
* lmo - Lua Machine Objects - General header
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _TEMPLATE_LMO_H_
#define _TEMPLATE_LMO_H_
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <fnmatch.h>
#include <dirent.h>
#include <ctype.h>
#include <limits.h>
#if (defined(__GNUC__) && defined(__i386__))
#define sfh_get16(d) (*((const uint16_t *) (d)))
#else
#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
struct lmo_entry {
uint32_t key_id;
uint32_t val_id;
uint32_t offset;
uint32_t length;
} __attribute__((packed));
typedef struct lmo_entry lmo_entry_t;
struct lmo_archive {
int fd;
int length;
uint32_t size;
lmo_entry_t *index;
char *mmap;
char *end;
struct lmo_archive *next;
};
typedef struct lmo_archive lmo_archive_t;
struct lmo_catalog {
char lang[6];
struct lmo_archive *archives;
struct lmo_catalog *next;
};
typedef struct lmo_catalog lmo_catalog_t;
uint32_t sfh_hash(const char *data, int len);
uint32_t lmo_canon_hash(const char *data, int len);
lmo_archive_t * lmo_open(const char *file);
void lmo_close(lmo_archive_t *ar);
extern lmo_catalog_t *_lmo_catalogs;
extern lmo_catalog_t *_lmo_active_catalog;
int lmo_load_catalog(const char *lang, const char *dir);
int lmo_change_catalog(const char *lang);
int lmo_translate(const char *key, int keylen, char **out, int *outlen);
void lmo_close_catalog(const char *lang);
#endif

Binary file not shown.

48
lean/ipset-lists/Makefile Normal file
View File

@ -0,0 +1,48 @@
#
# Copyright (c) 2015 Justin Liu
# Author: Justin Liu <rssnsj@gmail.com>
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ipset-lists
PKG_VERSION:=20171019
PKG_RELEASE:=3
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/ipset-lists
CATEGORY:=Network
TITLE:=Service for IPSET address tables
MAINTAINER:=Justin Liu <rssnsj@gmail.com>
DEPENDS:=+ipset
endef
define Package/ipset-lists/conffiles
/etc/gfwlist/china-banned
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)
define Package/ipset-lists/install
$(CP) -a files/* $(1)/
endef
define Package/ipset-lists/postinst
#!/bin/sh
if [ -e /etc/openwrt_release ]; then
/etc/init.d/ipset.sh restart
/etc/init.d/ipset.sh enable || :
fi
endef
$(eval $(call BuildPackage,ipset-lists))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,95 @@
v.youku.com
api.youku.com
v2.tudou.com
www.tudou.com
s.plcloud.music.qq.com
i.y.qq.com
hot.vrs.sohu.com
live.tv.sohu.com
pad.tv.sohu.com
my.tv.sohu.com
hot.vrs.letv.com
data.video.qiyi.com
cache.video.qiyi.com
cache.vip.qiyi.com
vv.video.qq.com
tt.video.qq.com
ice.video.qq.com
tjsa.video.qq.com
a10.video.qq.com
xyy.video.qq.com
vcq.video.qq.com
vsh.video.qq.com
vbj.video.qq.com
bobo.video.qq.com
flvs.video.qq.com
bkvv.video.qq.com
info.zb.qq.com
geo.js.kankan.xunlei.com
web-play.pptv.com
web-play.pplive.cn
dyn.ugc.pps.tv
v.pps.tv
inner.kandian.com
ipservice.163.com
so.open.163.com
zb.s.qq.com
ip.kankan.xunlei.com
vxml.56.com
music.sina.com.cn
play.baidu.com
v.iask.com
tv.weibo.com
wtv.v.iask.com
video.sina.com.cn
www.yinyuetai.com
api.letv.com
live.gslb.letv.com
static.itv.letv.com
ip.apps.cntv.cn
vdn.apps.cntv.cn
vdn.live.cntv.cn
vip.sports.cntv.cn
a.play.api.3g.youku.com
i.play.api.3g.youku.com
api.3g.youku.com
tv.api.3g.youku.com
play.api.3g.youku.com
play.api.3g.tudou.com
tv.api.3g.tudou.com
api.3g.tudou.com
api.tv.sohu.com
access.tv.sohu.com
iface.iqiyi.com
iface2.iqiyi.com
cache.m.iqiyi.com
dynamic.app.m.letv.com
dynamic.meizi.app.m.letv.com
dynamic.search.app.m.letv.com
dynamic.live.app.m.letv.com
listso.m.areainfo.ppstream.com
epg.api.pptv.com
play.api.pptv.com
m.letv.com
interface.bilibili.com
3g.music.qq.com
mqqplayer.3g.qq.com
proxy.music.qq.com
proxymc.qq.com
ip2.kugou.com
ip.kugou.com
client.api.ttpod.com
mobi.kuwo.cn
mobilefeedback.kugou.com
tingapi.ting.baidu.com
music.baidu.com
serviceinfo.sdk.duomi.com
music.163.com
www.xiami.com
spark.api.xiami.com
iplocation.geo.qiyi.com
sns.video.qq.com
v5.pc.duomi.com
tms.is.ysten.com
internal.check.duokanbox.com
openapi.youku.com

View File

@ -0,0 +1,29 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2014 Justin Liu <rssnsj@gmail.com>
START=21
start()
{
local file
for file in /etc/ipset/*; do
[ -f $file ] || continue
ipset restore < $file
done
}
stop()
{
local file
for file in /etc/ipset/*; do
[ -f $file ] || continue
ipset destroy `basename $file`
done
}
restart()
{
stop >/dev/null 2>&1
start
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
create local hash:net family inet hashsize 1024 maxelem 65536
add local 10.0.0.0/8
add local 127.0.0.0/8
add local 172.16.0.0/12
add local 192.168.0.0/16
add local 224.0.0.0/3

View File

@ -0,0 +1,14 @@
--[[
Customize /etc/gfwlist.list content
Copyright (c) 2015 Justin Liu
Author: Justin Liu <rssnsj@gmail.com>
https://github.com/rssnsj/network-feeds
]]--
module("luci.controller.gfwlist", package.seeall)
function index()
local page
page = entry({"admin", "services", "gfwlist"}, cbi("gfwlist"), _("Domain Lists"))
page.dependent = true
end

View File

@ -0,0 +1,33 @@
--[[
Customize firewall-banned domain lists - /etc/gfwlist/
Copyright (c) 2015 Justin Liu
Author: Justin Liu <rssnsj@gmail.com>
https://github.com/rssnsj/network-feeds
]]--
local fs = require "nixio.fs"
function sync_value_to_file(value, file)
value = value:gsub("\r\n?", "\n")
local old_value = nixio.fs.readfile(file)
if value ~= old_value then
nixio.fs.writefile(file, value)
end
end
m = SimpleForm("gfwlist", translate("Domain Lists Settings"))
for e in fs.dir("/etc/gfwlist") do
glist = m:field(TextValue, e, e, nil)
glist.rmempty = false
glist.rows = 12
function glist.cfgvalue()
return nixio.fs.readfile("/etc/gfwlist/" .. e) or ""
end
function glist.write(self, section, value)
sync_value_to_file(value, "/etc/gfwlist/" .. e)
end
end
return m

View File

@ -0,0 +1,9 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Domain Lists Settings"
msgstr "域名列表设置"
msgid "Domain Lists"
msgstr "域名列表"

View File

@ -0,0 +1,3 @@
update:
./gen-china-routes.sh > ../files/etc/ipset/china
./gen-gfwlist.sh > ../files/etc/gfwlist/china-banned

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
#!/bin/bash -e
#
# Script for generating China IPv4 route table by merging APNIC.net data and IPIP.net data
#
china_routes_ipip()
{
[ -f ipip.txt ] || wget -4 https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt -O ipip.txt >&2 || exit 1
cat ipip.txt | xargs netmask | awk '{print $1}'
}
china_routes_apnic()
{
[ -f apnic.txt ] || wget -4 http://ftp.apnic.net/stats/apnic/delegated-apnic-latest -O apnic.txt >&2 || exit 1
cat apnic.txt | awk -F'|' -vc=CN '
function tobits(c) { for(n=0; c>=2; c/=2) n++; return 32-n; }
$2==c&&$3=="ipv4" { printf("%s/%d\n", $4, tobits($5)) }' |
xargs netmask | awk '{print $1}'
}
china_routes_merged()
{
[ -x ./ipv4-merger ] || gcc ipv4_merger.c -o ipv4-merger >&2
china_routes_apnic > china.apnic
china_routes_ipip > china.ipip
# Merge them together
cat china.apnic china.ipip | ./ipv4-merger | sed 's/\-/:/g' |
xargs netmask | awk '{print $1}' | awk -F/ '$2<=24' > china.merged
cat china.merged
}
# $1: ipset name
convert_routes_to_ipset()
{
local ipset_name="$1"
echo "create $ipset_name hash:net family inet hashsize 1024 maxelem 65536"
awk -vt="$ipset_name" '{ printf("add %s %s\n", t, $0) }'
}
generate_china_ipset()
{
china_routes_merged | convert_routes_to_ipset china
}
generate_inverted_china_routes()
{
(
china_routes_merged
echo 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 172.16.0.0/12 192.168.0.0/16 224.0.0.0/3
) |
xargs netmask -r | awk '{print $1}' |
awk -F- '
function iptoint(ip) { split(ip,arr,"."); n=0; for(i=1;i<=4;i++) n=n*256+arr[i]; return n; }
function inttoip(n) { a=int(n/16777216); b=int(n%16777216/65536); c=int(n%65536/256); d=n%256; return a "." b "." c "." d; }
BEGIN { st=0 }
{ x=st; y=iptoint($1); st=iptoint($2)+1; if(y>x) { print inttoip(x) ":" inttoip(y-1); } }' |
xargs netmask | awk '{print $1}'
}
##
case "$1" in
"")
generate_china_ipset
;;
-c)
china_routes_merged
;;
-r)
generate_inverted_china_routes
;;
*)
echo "Usage:"
echo " $0 generate China routes in ipset format"
echo " $0 -c generate China routes in IP/prefix format"
echo " $0 -r generate invert China routes"
;;
*)
esac

View File

@ -0,0 +1,29 @@
#!/bin/sh -e
generate_china_banned()
{
if [ ! -f gfwlist.txt ]; then
wget https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt -O gfwlist.b64 >&2
cat gfwlist.b64 | base64 -d > gfwlist.txt
rm -f gfwlist.b64
fi
cat gfwlist.txt base-gfwlist.txt | sort -u |
sed 's#!.\+##; s#|##g; s#@##g; s#http:\/\/##; s#https:\/\/##;' |
sed '/\*/d; /apple\.com/d; /sina\.cn/d; /sina\.com\.cn/d; /baidu\.com/d; /qq\.com/d' |
sed '/^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$/d' |
grep '^[0-9a-zA-Z\.-]\+$' | grep '\.' | sed 's#^\.\+##' | rev | sort -u |
awk '
BEGIN { prev = "________"; } {
cur = $0;
if (index(cur, prev) == 1 && substr(cur, 1 + length(prev) ,1) == ".") {
} else {
print cur;
prev = cur;
}
}' | rev | sort -u
}
generate_china_banned

View File

@ -0,0 +1,339 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
typedef u_int32_t u32;
typedef int bool;
#define true 1
#define false 0
typedef unsigned gfp_t;
static inline char *ipv4_hltos(u32 u, char *s)
{
static char ss[20];
if (!s)
s = ss;
sprintf(s, "%d.%d.%d.%d",
(int)(u >> 24) & 0xff, (int)(u >> 16) & 0xff,
(int)(u >> 8) & 0xff, (int)u & 0xff );
return s;
}
static inline u32 ipv4_stohl(const char *s)
{
int u[4];
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4) {
return (((u32)u[0] & 0xff) << 24) |
(((u32)u[1] & 0xff) << 16) |
(((u32)u[2] & 0xff) << 8) |
(((u32)u[3] & 0xff));
} else
return 0xffffffff;
}
static inline bool is_ipv4_addr(const char *s)
{
int u[4];
if (sscanf(s, "%d.%d.%d.%d", &u[0], &u[1], &u[2], &u[3]) == 4)
return true;
else
return false;
}
struct ipv4_range {
u32 start;
u32 end;
};
struct sa_open_data {
struct ipv4_range *tmp_base;
size_t tmp_size;
size_t tmp_length;
int errors;
};
static int __touch_tmp_base(struct sa_open_data *od, gfp_t gfp)
{
if (!od->tmp_base) {
/**
* Allocate a temporary table with twice the size of the previous
* table or at least 100, on which new entries can be inserted.
*/
if (od->tmp_size < 100)
od->tmp_size = 100;
od->tmp_base = (struct ipv4_range *)malloc(
sizeof(struct ipv4_range) * od->tmp_size /*, gfp*/ );
if (!od->tmp_base) {
fprintf(stderr,
"salist: cannot allocate the temporary list for enlarging it.\n");
return -ENOMEM;
}
od->tmp_length = 0;
}
return 0;
}
static int ipv4_list_add_range(struct sa_open_data *od, u32 start,
u32 end, gfp_t gfp)
{
struct ipv4_range *cur;
int ret;
/* Ignore a new range if it or a larger range already exists */
//if (salist_check_ipv4(od->table, start, end))
// return 0;
if ((ret = __touch_tmp_base(od, gfp)) < 0)
return ret;
/* Check if the size is efficient. Enlarge it if needed. */
if (od->tmp_length + 1 >= od->tmp_size) {
size_t old_size = od->tmp_size;
struct ipv4_range *old_base = od->tmp_base;
od->tmp_size *= 2;
od->tmp_base = (struct ipv4_range *)realloc(od->tmp_base,
sizeof(struct ipv4_range) * od->tmp_size);
if (!od->tmp_base) {
od->tmp_size = old_size;
od->tmp_base = old_base;
return -ENOMEM;
}
}
cur = &od->tmp_base[od->tmp_length++];
cur->start = start;
cur->end = end;
return 0;
}
static inline int ipv4_list_add_netmask(struct sa_open_data *od,
u32 net, u32 net_mask, gfp_t gfp)
{
u32 start = net & net_mask;
u32 end = net | ~net_mask;
return ipv4_list_add_range(od, start, end, gfp);
}
static int ipv4_list_add_net(struct sa_open_data *od, u32 net,
int net_bits, gfp_t gfp)
{
u32 net_mask;
if(net_bits == 0)
net_mask = 0x00000000;
else
net_mask = ~(((u32)1 << (32 - net_bits)) - 1);
//printf("%d: %08x, %08x\n", net_bits, net_mask, net_size);
return ipv4_list_add_netmask(od, net, net_mask, gfp);
}
static int salist_cmd_parse(struct sa_open_data *od, char *cmd, gfp_t gfp)
{
char *a1 = NULL, *a2 = NULL;
char *sep;
char sc;
int n = 32;
/* Case 3: Append an item */
/* Check IP description part: network segment or range? */
if ((sep = strchr(cmd, '/'))) { }
else if ((sep = strchr(cmd, '-'))) { }
else if ((sep = strchr(cmd, ':'))) { }
if (sep) {
/* Describes a subnet or range. */
sc = *sep;
*sep = '\0';
a1 = cmd;
a2 = sep + 1;
if (*a2 == '\0') {
fprintf(stderr, "Nothing after '%c'.\n", sc);
return -EINVAL;
}
} else {
/* Describes a single IP. */
sc = '\0';
a1 = cmd;
}
switch (sc) {
case '/':
/* 10.10.20.0/24 */
/* ------------------------------------ */
if (is_ipv4_addr(a2)) {
ipv4_list_add_netmask(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
} else {
sscanf(a2, "%d", &n);
ipv4_list_add_net(od, ipv4_stohl(a1), n, gfp);
}
/* ------------------------------------ */
break;
case ':':
case '-':
/* 10.10.20.0-10.20.0.255 */
/* ------------------------------------ */
ipv4_list_add_range(od, ipv4_stohl(a1), ipv4_stohl(a2), gfp);
/* ------------------------------------ */
break;
default:
if (is_ipv4_addr(a1)) {
/* Single IP address. */
u32 ip = ipv4_stohl(a1);
/* ------------------------------------ */
ipv4_list_add_range(od, ip, ip, gfp);
/* ------------------------------------ */
} else {
fprintf(stderr, "Invalid IP address '%s'.\n", a1);
return -EINVAL;
}
break;
}
return 0;
}
static int ipv4_range_sort_cmp(const void *a, const void *b)
{
struct ipv4_range *ra = (struct ipv4_range *)a;
struct ipv4_range *rb = (struct ipv4_range *)b;
if (ra->start > rb->start) {
return 1;
} else if (ra->start < rb->start) {
return -1;
} else if (ra->end > rb->end) {
return 1;
} else if (ra->end < rb->end) {
return -1;
} else {
return 0;
}
}
static void ipv4_range_swap(void *a, void *b, int size)
{
struct ipv4_range *ra = (struct ipv4_range *)a;
struct ipv4_range *rb = (struct ipv4_range *)b;
struct ipv4_range tmp;
tmp = *ra;
*ra = *rb;
*rb = tmp;
}
static struct sa_open_data *salist_open(void)
{
struct sa_open_data *od = NULL;
od = (struct sa_open_data *)malloc(sizeof(*od));
if (!od) {
fprintf(stderr, "salist: cannot allocate sa_open_data.\n");
return NULL;
}
memset(od, 0, sizeof(*od));
od->errors = 0;
return od;
}
static int salist_close(struct sa_open_data *od)
{
size_t ri, wi;
struct ipv4_range *old_base;
/* Flush the table if any modification has been done */
if (od->tmp_base) {
/* Sort the table and merge entries as many as possible. */
if (od->tmp_length >= 2) {
qsort(od->tmp_base, od->tmp_length, sizeof(struct ipv4_range),
ipv4_range_sort_cmp);
for (wi = 0, ri = 1; ri < od->tmp_length; ri++) {
/* NOTICE: 0xffffffff + 1 ? */
if (od->tmp_base[wi].end == (u32)(-1)) {
/* Nothing */
} else if (od->tmp_base[ri].start <= od->tmp_base[wi].end + 1) {
/* The two ranges overlap, so merge the 2nd to the 1st one */
if (od->tmp_base[ri].end > od->tmp_base[wi].end)
od->tmp_base[wi].end = od->tmp_base[ri].end;
} else {
wi++;
if (wi < ri)
od->tmp_base[wi] = od->tmp_base[ri];
}
}
od->tmp_length = wi + 1;
}
/* Reduce the size */
if (od->tmp_length < od->tmp_size) {
struct ipv4_range *__tmp = od->tmp_base;
od->tmp_base = (struct ipv4_range *)malloc(
sizeof(struct ipv4_range) * (od->tmp_length ? od->tmp_length : 1));
if (od->tmp_base) {
memcpy(od->tmp_base, __tmp,
sizeof(struct ipv4_range) * od->tmp_length);
free(__tmp);
} else {
fprintf(stderr, "[%s:%d] Failed to allocate temporary table.\n",
__FUNCTION__, __LINE__);
/* If failed to allocate new memory, do not reduce it. */
od->tmp_base = __tmp;
}
}
/* Dump the table instead */
}
if (od->errors) {
fprintf(stderr, "[%s] %d errors detected during table operation.\n",
__FUNCTION__, od->errors);
}
return 0;
}
static void sa_open_data_dump(struct sa_open_data *od)
{
size_t i;
char s1[20], s2[20];
for (i = 0; i < od->tmp_length; i++) {
printf("%s-%s\n", ipv4_hltos(od->tmp_base[i].start, s1),
ipv4_hltos(od->tmp_base[i].end, s2));
}
}
int main(int argc, char *argv[])
{
struct sa_open_data *od;
char lbuf[128];
od = salist_open();
while (fgets(lbuf, sizeof(lbuf), stdin)) {
size_t llen = strlen(lbuf);
if (llen > 0 && lbuf[llen - 1] == '\n')
lbuf[--llen] = '\0';
if (llen > 0 && lbuf[llen - 1] == '\r')
lbuf[--llen] = '\0';
if (llen == 0)
continue;
salist_cmd_parse(od, lbuf, 0);
}
salist_close(od);
sa_open_data_dump(od);
return 0;
}

56
lean/ipv6-helper/Makefile Normal file
View File

@ -0,0 +1,56 @@
#
# Copyright (C) 2015 OpenWrt-dist
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ipv6helper
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=LEAN
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/ipv6helper
SECTION:=ipv6
TITLE:=IPv6 Helper and Dynamic Update he.net of ip
PKGARCH:=all
DEPENDS:=+luci-proto-ipv6 +wget +ip6tables +kmod-ipt-nat6 +odhcpd-ipv6only +odhcp6c +6in4
endef
define Package/ipv6helper/description
IPv6 Helper and Dynamic Update he.net of ip
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/ipv6helper/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
chmod 755 /etc/hotplug.d/iface/60-6in4 >/dev/null 2>&1
fi
exit 0
endef
define Package/ipv6helper/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/root/etc/hotplug.d/iface/60-6in4 $(1)/etc/hotplug.d/iface/60-6in4
endef
$(eval $(call BuildPackage,ipv6helper))

View File

@ -0,0 +1,12 @@
#!/bin/sh
. /lib/functions.sh
if [ "$ACTION" != "ifup" ]; then
exit
fi
config_load network
config_get tunnelid $INTERFACE tunnelid
config_get username $INTERFACE username
config_get password $INTERFACE password
if [ "$tunnelid" != "" ]; then
wget -O - https://$username:$password@ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid --no-check-certificate
fi

View File

@ -0,0 +1,42 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=k3wifi
PKG_VERSION:=1
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
TITLE:=k3wifi
DEPENDS:=
URL:=http://www.k3wifi.com/
endef
define Package/$(PKG_NAME)/description
k3wifi fw
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DIR) $(1)/lib/firmware/brcm
$(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -0,0 +1,47 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=k3screenctrl
PKG_VERSION:=0.10
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/updateing/k3screenctrl.git
PKG_SOURCE_VERSION:=dd05ce9a5cb0cb6cebfc6b3b5823c7f6d75796ff
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_MAINTAINER:=Hamster Tian <haotia@gmail.com>
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS+= -D_GNU_SOURCE
define Package/k3screenctrl
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=@TARGET_bcm53xx_DEVICE_phicomm-k3 +@KERNEL_DEVMEM
TITLE:=LCD screen controller on PHICOMM K3
URL:=https://github.com/updateing/k3-screen-ctrl
endef
define Package/k3screenctrl/description
K3 Screen Controller (k3screenctrl) is a program utilizing
the LCD screen on PHICOMM K3 to display some stats.
endef
define Package/k3screenctrl/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/lib/k3screenctrl
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/k3screenctrl $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wan.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wifi.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/port.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/basic.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/host.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) ./files/k3screenctrl.init $(1)/etc/init.d/k3screenctrl
endef
$(eval $(call BuildPackage,k3screenctrl))

View File

@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common
START=99
STOP=99
SCRIPTS_BASE=/lib/k3screenctrl/
start() {
/usr/bin/k3screenctrl &
}
stop() {
killall k3screenctrl
}

93
lean/libidn2/Makefile Normal file
View File

@ -0,0 +1,93 @@
#
# Copyright (C) 2017-2018 Daniel Engberg <daniel.engberg.lists@pyret.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libidn2
PKG_VERSION:=2.0.4
PKG_RELEASE:=1
PKG_MAINTAINER:=Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
PKG_LICENSE:=GPL-2.0-or-later LGPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING COPYINGv2 COPYING.LESSERv3
PKG_SOURCE_URL:=@GNU/libidn
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_HASH:=644b6b03b285fb0ace02d241d59483d98bc462729d8bb3608d5cad5532f3d2f0
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/idn2/Default
SECTION:=net
CATEGORY:=Network
URL:=http://www.gnu.org/software/libidn/
endef
define Package/idn2/Default/description
Libidn2 is a free software implementation of IDNA2008,
Punycode and TR46 in library form. It contains
functionality to convert internationalized domain
names to and from ASCII Compatible Encoding (ACE),
following the IDNA2008 and TR46 standards.
endef
define Package/idn2
$(call Package/idn2/Default)
SUBMENU:=IP Addresses and Names
TITLE:=GNU IDN2 (Internationalized Domain Name) tool
DEPENDS:=+libidn2
endef
define Package/idn2/description
$(call Package/idn2/Default/description)
Command line tool using libidn2
endef
define Package/libidn2
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libunistring $(ICONV_DEPENDS) $(INTL_DEPENDS)
TITLE:=International domain name library (IDNA2008, Punycode and TR46)
URL:=https://www.gnu.org/software/libidn/#libidn2
endef
define Package/libidn2/description
$(call Package/idn2/Default/description)
Library only package
endef
CONFIGURE_ARGS += \
--disable-rpath \
--disable-doc
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/idn2.h $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libidn2.pc $(1)/usr/lib/pkgconfig/
endef
define Package/idn2/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
define Package/libidn2/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,idn2))
$(eval $(call BuildPackage,libidn2))

View File

@ -0,0 +1,18 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Adbyby
LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-adbyby-plus
PKG_VERSION:=2.0
PKG_RELEASE:=32
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,18 @@
module("luci.controller.adbyby", package.seeall)
function index()
if not nixio.fs.access("/etc/config/adbyby") then
return
end
entry({"admin", "services", "adbyby"}, cbi("adbyby"), _("ADBYBY Plus +"), 10).dependent = true
entry({"admin","services","adbyby","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep adbyby >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,178 @@
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
m = Map("adbyby")
m.title = translate("Adbyby Plus +")
m.description = translate("Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Hostfiltering ads without losing bandwidth</font>")
m:section(SimpleSection).template = "adbyby/adbyby_status"
s = m:section(TypedSection, "adbyby")
s.anonymous = true
s:tab("basic", translate("Base Setting"))
o = s:taboption("basic", Flag, "enable")
o.title = translate("Enable")
o.default = 0
o.rmempty = false
o = s:taboption("basic", ListValue, "wan_mode")
o.title = translate("Running Mode")
o:value("0", translate("Global ModeThe slowest, the best effects"))
o:value("1", translate("Plus + ModeFilter domain name list and blacklist website.Recommended"))
o:value("2", translate("No filter Mode (Must set in Client Filter Mode Settings manually)"))
o.default = 1
o.rmempty = false
mem = s:taboption("basic", Flag, "mem_mode")
mem.title = translate("RAM Running Mode")
mem.default = 1
mem.rmempty = false
mem.description = translate("Running Adbyby in RAM.More speed,less disk consumption")
local DL = SYS.exec("head -1 /usr/share/adbyby/data/lazy.txt | awk -F' ' '{print $3,$4}'")
local DV = SYS.exec("head -1 /usr/share/adbyby/data/video.txt | awk -F' ' '{print $3,$4}'")
local NR = SYS.exec("grep -v '^!' /usr/share/adbyby/data/rules.txt | wc -l")
local NU = SYS.exec("cat /usr/share/adbyby/data/user.txt | wc -l")
--local NW = SYS.exec("uci get adbyby.@adbyby[-1].domain 2>/dev/null | wc -l")
local ND = SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
o = s:taboption("basic", Button, "restart")
o.title = translate("Adbyby and Rule state")
o.inputtitle = translate("Restart Adbyby")
o.description = translate(string.format("<strong>Lazy Rule</strong>%s <strong>&nbsp;&nbsp;Video Rule</strong>%s<br /><strong>Third Party Subscription Rule</strong>%d lines&nbsp;&nbsp;<strong>User-defined Rule</strong>%d lines", DL, DV, math.abs(NR-NU), NR))
o.inputstyle = "reload"
o.write = function()
SYS.call("nohup sh /usr/share/adbyby/adupdate.sh > /tmp/adupdate.log 2>&1 &")
SYS.call("sleep 4")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
s:tab("advanced", translate("Advance Setting"))
o = s:taboption("advanced", Flag, "cron_mode")
o.title = translate("Update the rule at 6 a.m. every morning and restart adbyby")
o.default = 0
o.rmempty = false
o.description = translate(string.format("<strong><font color=blue>Adblock Plus Host List</font></strong> %s Lines<br /><br />", ND))
updatead = s:taboption("advanced", Button, "updatead", translate("Manually force update<br />Adblock Plus Host List"), translate("Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run. <br / > After completed it would automatically refresh, please do not duplicate click!"))
updatead.inputtitle = translate("Manually force update")
updatead.inputstyle = "apply"
updatead.write = function()
SYS.call("nohup sh /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1 &")
end
o = s:taboption("advanced", Flag, "update_source")
o.title = translate("Update adbyby rules form official website first")
o.default = 1
o.rmempty = false
o = s:taboption("advanced", Flag, "block_ios")
o.title = translate("Block Apple iOS OTA update")
o.default = 0
o.rmempty = false
s:tab("help", translate("Plus+ Domain List"))
local conf = "/usr/share/adbyby/adhost.conf"
o = s:taboption("help", TextValue, "conf")
o.description = translate("!Note that you should fill to the domain name ONLY. For example, http://www.baidu.com only needs to write to baidu.com. One line for each")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(conf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(conf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("esc", translate("Bypass Domain List"))
local escconf = "/usr/share/adbyby/adesc.conf"
o = s:taboption("esc", TextValue, "escconf")
o.description = translate("!Will Never filter these Domain")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(escconf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(escconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("black", translate("Black Domain List"))
local blackconf = "/usr/share/adbyby/adblack.conf"
o = s:taboption("black", TextValue, "blackconf")
o.description = translate("!Will Always block these Domain")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(blackconf) or ""
end
o.write = function(self, section, value)
NXFS.writefile(blackconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("block", translate("Black IP List"))
local blockconf = "/usr/share/adbyby/blockip.conf"
o = s:taboption("block", TextValue, "blockconf")
o.description = translate("!Will Always block these IP")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(blockconf) or " "
end
o.write = function(self, section, value)
NXFS.writefile(blockconf, value:gsub("\r\n", "\n"))
--SYS.call("/etc/init.d/adbyby restart")
end
s:tab("user", translate("User-defined Rule"))
local file = "/usr/share/adbyby/rules.txt"
o = s:taboption("user", TextValue, "rules")
o.description = translate("Each line of the beginning exclamation mark is considered an annotation.")
o.rows = 13
o.wrap = "off"
o.cfgvalue = function(self, section)
return NXFS.readfile(file) or ""
end
o.write = function(self, section, value)
NXFS.writefile(file, value:gsub("\r\n", "\n"))
end
t=m:section(TypedSection,"acl_rule",translate("<strong>Client Filter Mode Settings</strong>"),
translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."))
t.template="cbi/tblsection"
t.sortable=true
t.anonymous=true
t.addremove=true
e=t:option(Value,"ipaddr",translate("IP Address"))
e.width="40%"
e.datatype="ip4addr"
e.placeholder="0.0.0.0/0"
luci.ip.neighbors({ family = 4 }, function(entry)
if entry.reachable then
e:value(entry.dest:string())
end
end)
e=t:option(ListValue,"filter_mode",translate("Filter Mode"))
e.width="40%"
e.default="disable"
e.rmempty=false
e:value("disable",translate("No filter"))
e:value("global",translate("Global filter"))
return m

View File

@ -0,0 +1,22 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[adbyby]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('adbyby_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>Adbyby Plus+ <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>Adbyby Plus+ <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="adbyby_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -0,0 +1,125 @@
msgid "ADBYBY Plus +"
msgstr "广告屏蔽大师 Plus+"
msgid "<strong><font color=\"green\">Adbyby Plus + is Running</font></strong>"
msgstr "<strong><font color=\"green\">广告屏蔽大师 Plus + 正在运行</font></strong>"
msgid "<strong><font color=\"red\">Adbyby Plus + is Not Running</font></strong>"
msgstr "<strong><font color=\"red\">广告屏蔽大师 Plus + 没有运行</font></strong>"
msgid "Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Hostfiltering ads without losing bandwidth</font>"
msgstr "广告屏蔽大师 Plus + 可以全面过滤各种横幅、弹窗、视频广告,同时阻止跟踪、隐私窃取及各种恶意网站<br /><font color=\"red\">Plus + 版本可以和 Adblock Plus Host 结合方式运行,过滤广告不损失带宽</font>"
msgid "Adbyby Plus +"
msgstr "广告屏蔽大师 Plus+"
msgid "Base Setting"
msgstr "基本设置"
msgid "Running Mode"
msgstr "运行模式"
msgid "Global ModeThe slowest, the best effects"
msgstr "全局模式(最慢, 效果最好)"
msgid "Plus + ModeFilter domain name list and blacklist website.Recommended"
msgstr "Plus + 模式只过滤列表内域名结合ABP名单。推荐"
msgid "No filter Mode (Must set in Client Filter Mode Settings manually)"
msgstr "手动代理模式(必须手动设置浏览器代理,或者客户端过滤模式设置)"
msgid "Transparent proxy"
msgstr "透明代理"
msgid "Click to disable"
msgstr "点击关闭"
msgid "Click to enable"
msgstr "点击开启"
msgid "Adbyby and Rule state"
msgstr "规则状态"
msgid "Restart Adbyby"
msgstr "重启Adbyby"
msgid "Plus+ Domain List"
msgstr "Plus+ 模式过滤的域名"
msgid "Bypass Domain List"
msgstr "域名白名单"
msgid "Black Domain List"
msgstr "域名黑名单"
msgid "Black IP List"
msgstr "IP黑名单"
msgid "Advance Setting"
msgstr "高级设置"
msgid "Update the rule at 6 a.m. every morning and restart adbyby"
msgstr "每天凌晨6点更新规则并重启"
msgid "Manually force update<br />Adblock Plus Host List"
msgstr "手动强制更新<br />Adblock Plus Host List"
msgid "Manually force update"
msgstr "手动强制更新"
msgid "Block Apple iOS OTA update"
msgstr "拦截 Apple iOS 的OTA更新"
msgid "RAM Running Mode"
msgstr "内存运行模式"
msgid "Running Adbyby in RAM.More speed,less disk consumption"
msgstr "在内存中运行Adbyby。更快的速度更少的存储空间损耗"
msgid "User-defined Rule"
msgstr "用户自定义规则"
msgid "<strong>Client Filter Mode Settings</strong>"
msgstr "<strong>客户端过滤模式设置</strong>"
msgid "Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default."
msgstr "可以为局域网客户端分别设置不同的过滤模式 ( <font color=blue> 不过滤 , 全局过滤 </font> ) 。默认无需设置"
msgid "IP Address"
msgstr "IP地址"
msgid "Filter Mode"
msgstr "过滤模式"
msgid "!Note that you should fill to the domain name ONLY. For example, http://www.baidu.com only needs to write to baidu.com. One line for each"
msgstr "这些域名在 Plus 模式中会被过滤。你需要要填写域名即可,例如 http://www.baidu.com你写 baidu.com 即可。每行一个域名"
msgid "!Will Never filter these Domain"
msgstr "永不过滤白名单内的域名(所有模式中生效)"
msgid "!Will Always block these Domain"
msgstr "拦截黑名单内的域名(所有模式中生效)"
msgid "!Will Always block these IP"
msgstr "拦截黑名单内的IP地址所有模式中生效"
msgid "Each line of the beginning exclamation mark is considered an annotation."
msgstr "每行一条规则,感叹号开头的被认为是注释"
msgid "<strong><font color=blue>Adblock Plus Host List</font></strong>"
msgstr "<strong><font color=blue>Adblock Plus Host 列表:</font></strong>"
msgid "Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run. <br / > After completed it would automatically refresh, please do not duplicate click!"
msgstr "注意需要下载并转换规则。后台进程可能需要60-120秒运行。完成后会自动刷新请不要重复点击"
msgid "No filter"
msgstr "不过滤"
msgid "Global filter"
msgstr "全局过滤"
msgid "Update adbyby rules form official website first"
msgstr "优先从官方网站更新规则"

View File

@ -0,0 +1,11 @@
config adbyby
option daemon '2'
option lan_mode '0'
option cron_mode '1'
option block_ios '0'
option enable '0'
option wan_mode '1'
option mem_mode '1'
option update_source '1'

View File

@ -0,0 +1,218 @@
#!/bin/sh /etc/rc.common
START=99
STOP=10
EXTRA_COMMANDS="add_rule del_rule reload_rule"
PROG_PATH=/usr/share/adbyby
DATA_PATH=$PROG_PATH/data
WAN_FILE=/var/etc/dnsmasq-adbyby.d/03-adbyby-ipset.conf
CRON_FILE=/etc/crontabs/root
CONFIG=adbyby
ipt_n="iptables -t nat"
get_config()
{
config_get_bool enable $1 enable
config_get_bool cron_mode $1 cron_mode
config_get wan_mode $1 wan_mode
config_get_bool block_ios $1 block_ios 0
config_get_bool mem_mode $1 mem_mode 1
}
add_rules()
{
rm -f $DATA_PATH/user.bin
grep -v ^! $PROG_PATH/rules.txt > $DATA_PATH/user.txt
cp $PROG_PATH/rules.txt $DATA_PATH/rules.txt
}
add_cron()
{
if [ $cron_mode -eq 1 ]; then
sed -i '/adblock.sh/d' $CRON_FILE
echo '0 6 * * * /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1' >> $CRON_FILE
crontab $CRON_FILE
fi
}
del_cron()
{
sed -i '/adblock.sh/d' $CRON_FILE
/etc/init.d/cron restart
}
ip_rule()
{
ipset -N adbyby_esc hash:ip
$ipt_n -A ADBYBY -m set --match-set adbyby_esc dst -j RETURN
for i in $(seq 0 100)
do
local ip=$(uci_get_by_type acl_rule ipaddr '' $i)
local mode=$(uci_get_by_type acl_rule filter_mode '' $i)
case "$mode" in
disable)
$ipt_n -A ADBYBY -s $ip -j RETURN
;;
global)
$ipt_n -A ADBYBY -s $ip -p tcp -j REDIRECT --to-ports 8118
$ipt_n -A ADBYBY -s $ip -j RETURN
;;
esac
done
case $wan_mode in
0)
;;
1)
ipset -N adbyby_wan hash:ip
$ipt_n -A ADBYBY -m set ! --match-set adbyby_wan dst -j RETURN
;;
2)
$ipt_n -I ADBYBY -j RETURN
;;
esac
echo "create blockip hash:net family inet hashsize 1024 maxelem 65536" > /tmp/blockip.ipset
awk '!/^$/&&!/^#/{printf("add blockip %s'" "'\n",$0)}' /usr/share/adbyby/blockip.conf >> /tmp/blockip.ipset
ipset -! restore < /tmp/blockip.ipset 2>/dev/null
iptables -I FORWARD -m set --match-set blockip dst -j DROP
iptables -I OUTPUT -m set --match-set blockip dst -j DROP
}
add_dns()
{
mkdir -p /var/etc/dnsmasq-adbyby.d
mkdir -p /tmp/dnsmasq.d
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_esc"'\n",$0)}' $PROG_PATH/adesc.conf > /var/etc/dnsmasq-adbyby.d/06-dnsmasq.esc
awk '!/^$/&&!/^#/{printf("address=/%s/'"0.0.0.0"'\n",$0)}' $PROG_PATH/adblack.conf > /var/etc/dnsmasq-adbyby.d/07-dnsmasq.black
cat > /tmp/dnsmasq.d/dnsmasq-adbyby.conf <<EOF
conf-dir=/var/etc/dnsmasq-adbyby.d
EOF
local var=1
if [ $wan_mode -eq 1 ]; then
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_wan"'\n",$0)}' $PROG_PATH/adhost.conf > $WAN_FILE
if ls /var/etc/dnsmasq-adbyby.d/* >/dev/null 2>&1; then
mkdir -p /tmp/dnsmasq.d
cp /usr/share/adbyby/dnsmasq.adblock /var/etc/dnsmasq-adbyby.d/04-dnsmasq.adblock
cp /usr/share/adbyby/dnsmasq.ads /var/etc/dnsmasq-adbyby.d/05-dnsmasq.ads
fi
fi
sed -i '/mesu.apple.com/d' /etc/dnsmasq.conf && [ $block_ios -eq 1 ] && echo 'address=/mesu.apple.com/0.0.0.0' >> /etc/dnsmasq.conf
}
del_dns()
{
rm -f /tmp/dnsmasq.d/dnsmasq-adbyby.conf
rm -f /var/etc/dnsmasq-adbyby.d/*
rm -f /tmp/adbyby_host.conf
}
add_rule()
{
$ipt_n -N ADBYBY
$ipt_n -A ADBYBY -d 0.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 10.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 127.0.0.0/8 -j RETURN
$ipt_n -A ADBYBY -d 169.254.0.0/16 -j RETURN
$ipt_n -A ADBYBY -d 172.16.0.0/12 -j RETURN
$ipt_n -A ADBYBY -d 192.168.0.0/16 -j RETURN
$ipt_n -A ADBYBY -d 224.0.0.0/4 -j RETURN
$ipt_n -A ADBYBY -d 240.0.0.0/4 -j RETURN
ip_rule
$ipt_n -A ADBYBY -p tcp -j REDIRECT --to-ports 8118
$ipt_n -I PREROUTING -p tcp --dport 80 -j ADBYBY
}
del_rule()
{
$ipt_n -D PREROUTING -p tcp --dport 80 -j ADBYBY 2>/dev/null
$ipt_n -F ADBYBY 2>/dev/null
$ipt_n -X ADBYBY 2>/dev/null
iptables -D FORWARD -m set --match-set blockip dst -j DROP 2>/dev/null
iptables -D OUTPUT -m set --match-set blockip dst -j DROP 2>/dev/null
ipset -F adbyby_esc 2>/dev/null
ipset -X adbyby_esc 2>/dev/null
ipset -F adbyby_wan 2>/dev/null
ipset -X adbyby_wan 2>/dev/null
ipset -F blockip 2>/dev/null
ipset -X blockip 2>/dev/null
}
reload_rule()
{
config_load adbyby
config_foreach get_config adbyby
del_rule
iptables-save | grep ADBYBY >/dev/null || \
add_rule
}
start()
{
config_load adbyby
config_foreach get_config adbyby
[ $enable -eq 0 ] && exit 0
add_cron
if [ $mem_mode -eq 1 ]; then
echo "start mem mode"
if mount | grep adbyby >/dev/null 2>&1; then
echo "has mount"
else
echo "mount adbyby"
[ ! -d "/tmp/adbyby" ] && mkdir -p /tmp/adbyby && cp -a $PROG_PATH/data /tmp/adbyby/
mount --bind /tmp/adbyby/data $PROG_PATH/data
fi
fi
echo "add adbyby rules"
add_rules
$PROG_PATH/adbyby &>/dev/null &
add_dns
iptables-save | grep ADBYBY >/dev/null || \
add_rule
/etc/init.d/dnsmasq restart
}
stop()
{
config_load adbyby
config_foreach get_config adbyby
del_rule
del_cron
del_dns
killall -q adbyby
if [ $mem_mode -eq 1 ]; then
echo "stop mem mode"
if mount | grep adbyby >/dev/null 2>&1; then
echo "umount adbyby"
umount /usr/share/adbyby/data
fi
fi
/etc/init.d/dnsmasq restart
}
uci_get_by_name() {
local ret=$(uci get $CONFIG.$1.$2 2>/dev/null)
echo ${ret:=$3}
}
uci_get_by_type() {
local index=0
if [ -n $4 ]; then
index=$4
fi
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
echo ${ret:=$3}
}

View File

@ -0,0 +1,3 @@
#!/bin/sh
sleep 30 && sh /usr/share/adbyby/adupdate.sh

View File

@ -0,0 +1,22 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@adbyby[-1]
add ucitrack adbyby
set ucitrack.@adbyby[-1].init=adbyby
commit ucitrack
delete firewall.adbyby
set firewall.adbyby=include
set firewall.adbyby.type=script
set firewall.adbyby.path=/usr/share/adbyby/firewall.include
set firewall.adbyby.reload=1
commit firewall
EOF
mkdir -p /etc/dnsmasq.d
/etc/init.d/adbyby stop
/etc/init.d/adbyby enable
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,14 @@
gvod.aiseejapp.atianqi.com
stat.pandora.xiaomi.com
upgrade.mishop.pandora.xiaomi.com
logonext.tv.kuyun.com
config.kuyun.com
mishop.pandora.xiaomi.com
dvb.pandora.xiaomi.com
api.ad.xiaomi.com
de.pandora.xiaomi.com
data.mistat.xiaomi.com
jellyfish.pandora.xiaomi.com
gallery.pandora.xiaomi.com
o2o.api.xiaomi.com
bss.pandora.xiaomi.com

View File

@ -0,0 +1,17 @@
#!/bin/sh
rm -f /tmp/dnsmasq.adblock
wget-ssl --no-check-certificate -O- https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/dnsmasq.adblock
if [ -s "/tmp/dnsmasq.adblock" ];then
sed -i '/youku.com/d' /tmp/dnsmasq.adblock
if ( ! cmp -s /tmp/dnsmasq.adblock /usr/share/adbyby/dnsmasq.adblock );then
mv /tmp/dnsmasq.adblock /usr/share/adbyby/dnsmasq.adblock
fi
fi
sh /usr/share/adbyby/adupdate.sh

View File

@ -0,0 +1,3 @@
weixin.qq.com
qpic.cn
imtt.qq.com

View File

@ -0,0 +1,69 @@
cbjs.baidu.com
list.video.baidu.com
nsclick.baidu.com
play.baidu.com
sclick.baidu.com
tieba.baidu.com
baidustatic.com
bdimg.com
bdstatic.com
share.baidu.com
hm.baidu.com
v.baidu.com
cpro.baidu.com
1000fr.net
atianqi.com
56.com
v-56.com
acfun.com
acfun.tv
baofeng.com
baofeng.net
cntv.cn
hoopchina.com.cn
funshion.com
fun.tv
hitvs.cn
hljtv.com
iqiyi.com
qiyi.com
agn.aty.sohu.com
itc.cn
kankan.com
ku6.com
letv.com
letvcloud.com
letvimg.com
pplive.cn
pps.tv
ppsimg.com
pptv.com
www.qq.com
l.qq.com
v.qq.com
video.sina.com.cn
tudou.com
wasu.cn
analytics-union.xunlei.com
kankan.xunlei.com
youku.com
hunantv.com
ifeng.com
renren.com
mediav.com
cnbeta.com
mydrivers.com
168f.info
doubleclick.net
126.net
sohu.com
163.com
right.com.cn
50bang.org
you85.cn
jiuzhilan.com
googles.com
cnbetacdn.com
ptqy.gitv.tv
admaster.com.cn
serving-sys.com

View File

@ -0,0 +1,24 @@
#!/bin/sh
update_source=$(uci get adbyby.@adbyby[0].update_source 2>/dev/null)
rm -f /usr/share/adbyby/data/*.bak
if [ $update_source -eq 1 ]; then
#wget-ssl -t 1 -T 10 -O /tmp/lazy.txt http://update.adbyby.com/rule3/lazy.jpg
#wget-ssl -t 1 -T 10 -O /tmp/video.txt http://update.adbyby.com/rule3/video.jpg
#wget-ssl -t 1 -T 10 -O /tmp/user.action http://update.adbyby.com/rule3/user.action
wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://opt.cn2qq.com/opt-file/lazy.txt
wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://opt.cn2qq.com/opt-file/video.txt
fi
[ ! -s "/tmp/lazy.txt" ] && wget-ssl --no-check-certificate -O /tmp/lazy.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt
[ ! -s "/tmp/video.txt" ] && wget-ssl --no-check-certificate -O /tmp/video.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt
[ -s "/tmp/lazy.txt" ] && ( ! cmp -s /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt ) && mv /tmp/lazy.txt /usr/share/adbyby/data/lazy.txt
[ -s "/tmp/video.txt" ] && ( ! cmp -s /tmp/video.txt /usr/share/adbyby/data/video.txt ) && mv /tmp/video.txt /usr/share/adbyby/data/video.txt
[ -s "/tmp/user.action" ] && ( ! cmp -s /tmp/user.action /usr/share/adbyby/user.action ) && mv /tmp/user.action /usr/share/adbyby/user.action
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/user.action
/etc/init.d/adbyby restart

View File

@ -0,0 +1 @@
2.2.2.2

View File

@ -0,0 +1,940 @@
address=/a.youdao.com/0.0.0.0
address=/adrs.sdo.com/0.0.0.0
address=/hiad.myweb.hinet.net/0.0.0.0
address=/log.interest.mix.sina.com.cn/0.0.0.0
address=/tuiguang.178.com/0.0.0.0
address=/0xxd.com/0.0.0.0
address=/104.195.62.12/0.0.0.0
address=/111.175.219.7/0.0.0.0
address=/111111qb.com/0.0.0.0
address=/112.124.98.75/0.0.0.0
address=/116.55.227.242/0.0.0.0
address=/122.227.254.195/0.0.0.0
address=/123hala.com/0.0.0.0
address=/139.159.32.82/0.0.0.0
address=/182.92.81.104/0.0.0.0
address=/1l1.cc/0.0.0.0
address=/201071.com/0.0.0.0
address=/2012ui.com/0.0.0.0
address=/211.167.105.131/0.0.0.0
address=/220.115.251.25/0.0.0.0
address=/221.204.213.222/0.0.0.0
address=/2m2n.com/0.0.0.0
address=/360baidus.com/0.0.0.0
address=/365bibi.com/0.0.0.0
address=/365safego.com/0.0.0.0
address=/366safego.com/0.0.0.0
address=/36pn.com/0.0.0.0
address=/3g.990.net/0.0.0.0
address=/52kmk.com/0.0.0.0
address=/58.215.179.159/0.0.0.0
address=/61.152.223.15/0.0.0.0
address=/68665565.com/0.0.0.0
address=/6dvip.com/0.0.0.0
address=/71sem.com/0.0.0.0
address=/77power.com/0.0.0.0
address=/7wen.cn/0.0.0.0
address=/7xz3.com/0.0.0.0
address=/81c.cn/0.0.0.0
address=/85tgw.com/0.0.0.0
address=/88rpg.net/0.0.0.0
address=/892155.com/0.0.0.0
address=/91ysa.com/0.0.0.0
address=/91zgm.com/0.0.0.0
address=/9377co.com/0.0.0.0
address=/9377os.com/0.0.0.0
address=/a907907.com/0.0.0.0
address=/ad000000.com/0.0.0.0
address=/adm-cnzz.net/0.0.0.0
address=/ads.uc.cn/0.0.0.0
address=/ajaxcdn.org/0.0.0.0
address=/aliyuncss.com/0.0.0.0
address=/aliyunxin.com/0.0.0.0
address=/amazingmagics.com/0.0.0.0
address=/aralego.com/0.0.0.0
address=/at98.com/0.0.0.0
address=/cangnews.com/0.0.0.0
address=/caob5.info/0.0.0.0
address=/cb.baidu.com/0.0.0.0
address=/cbjs.baidu.com/0.0.0.0
address=/cnxad.net/0.0.0.0
address=/cnzz.com.so/0.0.0.0
address=/code668.com/0.0.0.0
address=/cpcv.cc/0.0.0.0
address=/cpms.cc/0.0.0.0
address=/cpro.baidu.com/0.0.0.0
address=/cpro.baidustatic.com/0.0.0.0
address=/cpv6.com/0.0.0.0
address=/cpva.cc/0.0.0.0
address=/crdrjs.info/0.0.0.0
address=/csqiulong.com/0.0.0.0
address=/ctsywy.com/0.0.0.0
address=/cyacc.com/0.0.0.0
address=/czpush.com/0.0.0.0
address=/dashet.com/0.0.0.0
address=/datafastguru.info/0.0.0.0
address=/dou777.com/0.0.0.0
address=/drmcmm.baidu.com/0.0.0.0
address=/duiwai.baidu.com/0.0.0.0
address=/dvr8.com/0.0.0.0
address=/dw998.com/0.0.0.0
address=/dxssiyi.com/0.0.0.0
address=/e701.net/0.0.0.0
address=/e70123.com/0.0.0.0
address=/e708.net/0.0.0.0
address=/e719.net/0.0.0.0
address=/ecuc123.net/0.0.0.0
address=/eiv.baidu.com/0.0.0.0
address=/f1190.com/0.0.0.0
address=/f6ce.com/0.0.0.0
address=/f70123.com/0.0.0.0
address=/fd7c.com/0.0.0.0
address=/fjmeyer.com/0.0.0.0
address=/fu68.com/0.0.0.0
address=/fv99.com/0.0.0.0
address=/gf108.com/0.0.0.0
address=/gf1352.com/0.0.0.0
address=/gm682.com/0.0.0.0
address=/guduopu.com/0.0.0.0
address=/gzmjnx.cn/0.0.0.0
address=/gzqudou.com/0.0.0.0
address=/hao123rt.com/0.0.0.0
address=/haohaowan8.com/0.0.0.0
address=/haolew.com/0.0.0.0
address=/hfjuki.com/0.0.0.0
address=/hmp33.com/0.0.0.0
address=/hr44.com/0.0.0.0
address=/humanding.com/0.0.0.0
address=/i3818.com/0.0.0.0
address=/ihualun.com/0.0.0.0
address=/img80.net/0.0.0.0
address=/jczzjx.com/0.0.0.0
address=/jdlhg.com/0.0.0.0
address=/jhzl001.com/0.0.0.0
address=/jiyou2014.com/0.0.0.0
address=/jk939.com/0.0.0.0
address=/jlssbz.com/0.0.0.0
address=/jnrsjm.com/0.0.0.0
address=/johtzj.com/0.0.0.0
address=/jwqj.net/0.0.0.0
address=/jxjzny.com/0.0.0.0
address=/keyyou.net/0.0.0.0
address=/kingwam.com/0.0.0.0
address=/kmadou.com/0.0.0.0
address=/ku9377.com/0.0.0.0
address=/lajizhan.org/0.0.0.0
address=/le4le.com/0.0.0.0
address=/lishuanghao.com/0.0.0.0
address=/lzmm8.com/0.0.0.0
address=/mainbx.com/0.0.0.0
address=/mathads.com/0.0.0.0
address=/mlt01.com/0.0.0.0
address=/moodoocrv.com.cn/0.0.0.0
address=/mscimg.com/0.0.0.0
address=/nextcps.com/0.0.0.0
address=/niuxgame77.com/0.0.0.0
address=/notice.uchome.manyou.com/0.0.0.0
address=/oikxlcv.wang/0.0.0.0
address=/okm918.com/0.0.0.0
address=/p3tt.com/0.0.0.0
address=/pdsjycm.com/0.0.0.0
address=/pos.baidu.com/0.0.0.0
address=/qiqiww.com/0.0.0.0
address=/qucaigg.com/0.0.0.0
address=/re.taotaosou.com/0.0.0.0
address=/ruxianke.com/0.0.0.0
address=/rwjfs.com/0.0.0.0
address=/sgbfjs.info/0.0.0.0
address=/sharedaddomain.com/0.0.0.0
address=/show.kc.taotaosou.com/0.0.0.0
address=/si9377.com/0.0.0.0
address=/socdm.com/0.0.0.0
address=/spcode.baidu.com/0.0.0.0
address=/sstc360.com/0.0.0.0
address=/t70123.com/0.0.0.0
address=/taat00889.com/0.0.0.0
address=/tad.suning.com/0.0.0.0
address=/tc600.com/0.0.0.0
address=/tdayi.com/0.0.0.0
address=/tg.1155t.cn/0.0.0.0
address=/toourbb.com/0.0.0.0
address=/ubmcmm.baidustatic.com/0.0.0.0
address=/uoyrsd.com/0.0.0.0
address=/v707070.com/0.0.0.0
address=/victorjx.com/0.0.0.0
address=/w65p.com/0.0.0.0
address=/wdzsb.com.cn/0.0.0.0
address=/winvestern.com.cn/0.0.0.0
address=/wqsph.net/0.0.0.0
address=/ws341.com/0.0.0.0
address=/xa9t.com/0.0.0.0
address=/xabaitai.com/0.0.0.0
address=/xchgx.com/0.0.0.0
address=/xcy8.com/0.0.0.0
address=/xtxa.net/0.0.0.0
address=/xxad.cc/0.0.0.0
address=/xzyituo.com/0.0.0.0
address=/yk0712.com/0.0.0.0
address=/ymcqb.com/0.0.0.0
address=/yqw88.com/0.0.0.0
address=/yule8.net/0.0.0.0
address=/yyp17.com/0.0.0.0
address=/zgksb.com/0.0.0.0
address=/zgunion.cn/0.0.0.0
address=/zp22938576.com/0.0.0.0
address=/120.27.34.156/0.0.0.0
address=/122.228.236.165/0.0.0.0
address=/125.46.61.28/0.0.0.0
address=/192.184.10.171/0.0.0.0
address=/218.65.30.232/0.0.0.0
address=/27.255.67.120/0.0.0.0
address=/32345sf.com/0.0.0.0
address=/360safego.com/0.0.0.0
address=/3dm.huya.com/0.0.0.0
address=/5y9nfpes.52pk.com/0.0.0.0
address=/654mmm.com/0.0.0.0
address=/6d245gxt.52pk.com/0.0.0.0
address=/7mad.7m.cn/0.0.0.0
address=/801.tianyaui.com/0.0.0.0
address=/86file.megajoy.com/0.0.0.0
address=/8jkx.com/0.0.0.0
address=/96.43.97.243/0.0.0.0
address=/a-m-s.poco.cn/0.0.0.0
address=/a.baomihua.com/0.0.0.0
address=/a.xizi.com/0.0.0.0
address=/a2.b310.com/0.0.0.0
address=/a4.yeshj.com/0.0.0.0
address=/a5.yeshj.com/0.0.0.0
address=/a6.hujiang.com/0.0.0.0
address=/abc.hkepc.com/0.0.0.0
address=/acsystem.wasu.cn/0.0.0.0
address=/ad.17173.com/0.0.0.0
address=/ad.bjmama.net/0.0.0.0
address=/adadmin.house365.com/0.0.0.0
address=/add.dz19.net/0.0.0.0
address=/adf.dahe.cn/0.0.0.0
address=/adhome.1fangchan.com/0.0.0.0
address=/adk.funshion.com/0.0.0.0
address=/adm.265g.com/0.0.0.0
address=/adm.72zx.com/0.0.0.0
address=/adm.86wan.com/0.0.0.0
address=/adm.bbcss.com/0.0.0.0
address=/adm.funshion.com/0.0.0.0
address=/adm.jjj8.cn/0.0.0.0
address=/adm.qzbbs.com/0.0.0.0
address=/adm.xmfish.com/0.0.0.0
address=/adm.zbinfo.net/0.0.0.0
address=/adm.zzfish.cn/0.0.0.0
address=/admd.yam.com/0.0.0.0
address=/adnetpub.yaolan.com/0.0.0.0
address=/adp.cnool.net/0.0.0.0
address=/adpub.yaolan.com/0.0.0.0
address=/adpubs.yaolan.com/0.0.0.0
address=/adsclick.yx.js.cn/0.0.0.0
address=/adspending01.bwnet.com.tw/0.0.0.0
address=/afp.chinanews.com/0.0.0.0
address=/afp.wasu.cn/0.0.0.0
address=/afpcreative.wasu.cn/0.0.0.0
address=/ai.bioon.com/0.0.0.0
address=/aid.chinayk.com/0.0.0.0
address=/am.6park.com/0.0.0.0
address=/am.szhome.com/0.0.0.0
address=/app.acm.dzwww.com/0.0.0.0
address=/as.sinahk.net/0.0.0.0
address=/ashow.pcpop.com/0.0.0.0
address=/bb345.com/0.0.0.0
address=/besc.baidustatic.com/0.0.0.0
address=/biz.gexing.com/0.0.0.0
address=/biz.weibo.com/0.0.0.0
address=/btn.onlylady.com/0.0.0.0
address=/btn.pchome.net/0.0.0.0
address=/business.92wy.com/0.0.0.0
address=/by.7avz.com/0.0.0.0
address=/cacafly.net/0.0.0.0
address=/cachead.com/0.0.0.0
address=/cdn.wdlm.cn/0.0.0.0
address=/chidir.com/0.0.0.0
address=/cps.okbuy.com/0.0.0.0
address=/d.107788.com/0.0.0.0
address=/d.taomato.com/0.0.0.0
address=/d0.xcar.com.cn/0.0.0.0
address=/dd.xdnice.com/0.0.0.0
address=/de.as.pptv.com/0.0.0.0
address=/dfad.dfdaily.com/0.0.0.0
address=/dg.073img.com/0.0.0.0
address=/doubleclick.tv002.com/0.0.0.0
address=/dvs.china.com/0.0.0.0
address=/dvser.china.com/0.0.0.0
address=/e.yycqc.com/0.0.0.0
address=/eap.big5.enorth.com.cn/0.0.0.0
address=/eap.enorth.com.cn/0.0.0.0
address=/ebp.renren.com/0.0.0.0
address=/ecma.bdimg.com/0.0.0.0
address=/ecmb.bdimg.com/0.0.0.0
address=/fun.ynet.com/0.0.0.0
address=/g.gxorg.com/0.0.0.0
address=/g.hsw.cn/0.0.0.0
address=/g.ousns.net/0.0.0.0
address=/g1.0573ren.com/0.0.0.0
address=/g2.ousns.net/0.0.0.0
address=/ganjituiguang.ganji.com/0.0.0.0
address=/gdt.qq.com/0.0.0.0
address=/get.766.com/0.0.0.0
address=/gg.0598yu.com/0.0.0.0
address=/gg.18183.com/0.0.0.0
address=/gg.cs090.com/0.0.0.0
address=/gg.gao7.com/0.0.0.0
address=/gg.kugou.com/0.0.0.0
address=/gg.sonhoo.com/0.0.0.0
address=/gg.yxdown.com/0.0.0.0
address=/ggg.zj.com/0.0.0.0
address=/ggw.gusuwang.com/0.0.0.0
address=/ggw.watertu.com/0.0.0.0
address=/ggyq.xdkb.net/0.0.0.0
address=/go.hangzhou.com.cn/0.0.0.0
address=/goto.www.iciba.com/0.0.0.0
address=/gqgc.sz.zj.cn/0.0.0.0
address=/groupa.onlylady.com/0.0.0.0
address=/gsspcln.jp/0.0.0.0
address=/gt.yy.com/0.0.0.0
address=/guess.h.qhimg.com/0.0.0.0
address=/haxiu.miaotiao.com/0.0.0.0
address=/hdad.baike.com/0.0.0.0
address=/hiad.vmall.com/0.0.0.0
address=/hz.shouyoutv.com/0.0.0.0
address=/hzhyhm.com/0.0.0.0
address=/i.syasn.com/0.0.0.0
address=/iads.xinmin.cn/0.0.0.0
address=/idcot.com/0.0.0.0
address=/ifx.aifang.com/0.0.0.0
address=/image.6park.com/0.0.0.0
address=/image.9duw.com/0.0.0.0
address=/image.hh010.com/0.0.0.0
address=/image.lepan.cc/0.0.0.0
address=/images.chinaz.com/0.0.0.0
address=/images.gxsky.com/0.0.0.0
address=/img.3sjt.com/0.0.0.0
address=/img.9duw.com/0.0.0.0
address=/img1.126.net/0.0.0.0
address=/img2.126.net/0.0.0.0
address=/img2.www.fmdisk.com/0.0.0.0
address=/inte.sogou.com/0.0.0.0
address=/iwanad.baidu.com/0.0.0.0
address=/j.6avz.com/0.0.0.0
address=/j.7avz.com/0.0.0.0
address=/ja.gamersky.com/0.0.0.0
address=/jmsyzj.com/0.0.0.0
address=/js-1.pchome.net/0.0.0.0
address=/js.duotegame.com/0.0.0.0
address=/js.leshen.com/0.0.0.0
address=/js.pub.tom.com/0.0.0.0
address=/js.youxi369.com/0.0.0.0
address=/jxad.jx163.com/0.0.0.0
address=/knnwdyou.com/0.0.0.0
address=/leiqun.snxyf.com/0.0.0.0
address=/life.e0575.com/0.0.0.0
address=/lingdian98.com/0.0.0.0
address=/link.fobshanghai.com/0.0.0.0
address=/lxting.com/0.0.0.0
address=/m.aty.sohu.com/0.0.0.0
address=/manads.static.olcdn.com/0.0.0.0
address=/manage.wdfans.cn/0.0.0.0
address=/market.178.com/0.0.0.0
address=/market.21cn.com/0.0.0.0
address=/market.duowan.com/0.0.0.0
address=/media.cheshi-img.com/0.0.0.0
address=/money.qz828.com/0.0.0.0
address=/myad.toocle.com/0.0.0.0
address=/ok.432kkk.com/0.0.0.0
address=/p.szonline.net/0.0.0.0
address=/p.zol-img.com.cn/0.0.0.0
address=/p4p.sina.com.cn/0.0.0.0
address=/p8u.hinet.net/0.0.0.0
address=/panda.kdnet.net/0.0.0.0
address=/pcs1.app.joy.cn/0.0.0.0
address=/phpad.cqnews.net/0.0.0.0
address=/pic.0597kk.com/0.0.0.0
address=/pic.111cn.net/0.0.0.0
address=/pic.2u.com.cn/0.0.0.0
address=/pic.ea3w.com/0.0.0.0
address=/pic.fengniao.com/0.0.0.0
address=/pic.taian.com/0.0.0.0
address=/pic.xgo-img.com.cn/0.0.0.0
address=/playad.xjmg.com/0.0.0.0
address=/poster.weather.com.cn/0.0.0.0
address=/pp.7060.la/0.0.0.0
address=/pro.iweihai.cn/0.0.0.0
address=/pub.funshion.com/0.0.0.0
address=/pub.mop.com/0.0.0.0
address=/publicize.liao1.com/0.0.0.0
address=/publish.ad.youth.cn/0.0.0.0
address=/res.hunantv.com/0.0.0.0
address=/rh.qq.com/0.0.0.0
address=/same.chinadaily.com.cn/0.0.0.0
address=/same.eastmoney.com/0.0.0.0
address=/same.stockstar.com/0.0.0.0
address=/sc.tom.com/0.0.0.0
address=/sgg.southcn.com/0.0.0.0
address=/share.gzdsw.com/0.0.0.0
address=/shenleyuni.com/0.0.0.0
address=/shows.21cn.com/0.0.0.0
address=/so.6949.com/0.0.0.0
address=/sss.sege.xxx/0.0.0.0
address=/static.yujiehenaishang.com/0.0.0.0
address=/sub.powerapple.com/0.0.0.0
address=/super.cat898.com/0.0.0.0
address=/super.kdnet.net/0.0.0.0
address=/synacast.com/0.0.0.0
address=/tf.360.cn/0.0.0.0
address=/tg.delnapb.com/0.0.0.0
address=/tk.504pk.com/0.0.0.0
address=/tp.sgcn.com/0.0.0.0
address=/u.63kc.com/0.0.0.0
address=/u.cnzol.com/0.0.0.0
address=/union.china.com.cn/0.0.0.0
address=/untitled.dwstatic.com/0.0.0.0
address=/up.hiao.com/0.0.0.0
address=/v-56.com/0.0.0.0
address=/vas.funshion.com/0.0.0.0
address=/vupload.duowan.com/0.0.0.0
address=/web.900.la/0.0.0.0
address=/xc.macd.cn/0.0.0.0
address=/xs.houyi.baofeng.net/0.0.0.0
address=/yktj.yzz.cn/0.0.0.0
address=/zo66.com/0.0.0.0
address=/zt2088.com/0.0.0.0
address=/146.148.85.61/0.0.0.0
address=/hdapp1003-a.akamaihd.net/0.0.0.0
address=/hdapp1008-a.akamaihd.net/0.0.0.0
address=/hdsrc-a.akamaihd.net/0.0.0.0
address=/46.165.197.153/0.0.0.0
address=/46.165.197.231/0.0.0.0
address=/74.117.182.77/0.0.0.0
address=/78.140.131.214/0.0.0.0
address=/clkrev.com/0.0.0.0
address=/a.livesportmedia.eu/0.0.0.0
address=/a.ucoz.net/0.0.0.0
address=/a.watershed-publishing.com/0.0.0.0
address=/a04296f070c0146f314d-0dcad72565cb350972beb3666a86f246.r50.cf5.rackcdn.com/0.0.0.0
address=/ad.about.co.kr/0.0.0.0
address=/ad.accessmediaproductions.com/0.0.0.0
address=/ad.bitmedia.io/0.0.0.0
address=/ad.flux.com/0.0.0.0
address=/ad.foxnetworks.com/0.0.0.0
address=/ad.icasthq.com/0.0.0.0
address=/ad.idgtn.net/0.0.0.0
address=/ad.jamba.net/0.0.0.0
address=/ad.livere.co.kr/0.0.0.0
address=/ad.mail.ru/0.0.0.0
address=/ad.mesomorphosis.com/0.0.0.0
address=/ad.openmultimedia.biz/0.0.0.0
address=/ad.outsidehub.com/0.0.0.0
address=/ad.pickple.net/0.0.0.0
address=/ad.proxy.sh/0.0.0.0
address=/ad.r.worldssl.net/0.0.0.0
address=/ad.rambler.ru/0.0.0.0
address=/ad.reklamport.com/0.0.0.0
address=/ad.sensismediasmart.com.au/0.0.0.0
address=/ad.smartclip.net/0.0.0.0
address=/ad.spielothek.so/0.0.0.0
address=/ad.vidaroo.com/0.0.0.0
address=/ad.winningpartner.com/0.0.0.0
address=/add.bugun.com.tr/0.0.0.0
address=/adingo.jp.eimg.jp/0.0.0.0
address=/adn.ebay.com/0.0.0.0
address=/adplus.goo.mx/0.0.0.0
address=/ads.mp.mydas.mobi/0.0.0.0
address=/adscaspion.appspot.com/0.0.0.0
address=/adss.dotdo.net/0.0.0.0
address=/adz.zwee.ly/0.0.0.0
address=/aff.eteachergroup.com/0.0.0.0
address=/aff.marathonbet.com/0.0.0.0
address=/aff.svjump.com/0.0.0.0
address=/affil.mupromo.com/0.0.0.0
address=/affiliateprogram.keywordspy.com/0.0.0.0
address=/affiliates.allposters.com/0.0.0.0
address=/affiliatesmedia.sbobet.com/0.0.0.0
address=/affiliation.fotovista.com/0.0.0.0
address=/agenda.complex.com/0.0.0.0
address=/airpushmarketing.s3.amazonaws.com/0.0.0.0
address=/ais.abacast.com/0.0.0.0
address=/analytics.disneyinternational.com/0.0.0.0
address=/ard.ihookup.com/0.0.0.0
address=/award.sitekeuring.net/0.0.0.0
address=/b.babylon.com/0.0.0.0
address=/b.livesport.eu/0.0.0.0
address=/b92.putniktravel.com/0.0.0.0
address=/banner.101xp.com/0.0.0.0
address=/banner.3ddownloads.com/0.0.0.0
address=/banner.europacasino.com/0.0.0.0
address=/banner.telefragged.com/0.0.0.0
address=/banner.titancasino.com/0.0.0.0
address=/bl.wavecdn.de/0.0.0.0
address=/blamads-assets.s3.amazonaws.com/0.0.0.0
address=/bluhostedbanners.blucigs.com/0.0.0.0
address=/box.anchorfree.net/0.0.0.0
address=/btr.domywife.com/0.0.0.0
address=/c.netu.tv/0.0.0.0
address=/cas.clickability.com/0.0.0.0
address=/cash.neweramediaworks.com/0.0.0.0
address=/cerebral.typn.com/0.0.0.0
address=/cjmooter.xcache.kinxcdn.com/0.0.0.0
address=/clarity.abacast.com/0.0.0.0
address=/click.eyk.net/0.0.0.0
address=/clickstrip.6wav.es/0.0.0.0
address=/connect.summit.co.uk/0.0.0.0
address=/content.livesportmedia.eu/0.0.0.0
address=/cpm.amateurcommunity.de/0.0.0.0
address=/creatives.inmotionhosting.com/0.0.0.0
address=/creatives.summitconnect.co.uk/0.0.0.0
address=/d13czkep7ax7nj.cloudfront.net/0.0.0.0
address=/d140sbu1b1m3h0.cloudfront.net/0.0.0.0
address=/d15565yqt7pv7r.cloudfront.net/0.0.0.0
address=/d15gt9gwxw5wu0.cloudfront.net/0.0.0.0
address=/d17f2fxw547952.cloudfront.net/0.0.0.0
address=/d19972r8wdpby8.cloudfront.net/0.0.0.0
address=/d1ade4ciw4bqyc.cloudfront.net/0.0.0.0
address=/d1cl1sqtf3o420.cloudfront.net/0.0.0.0
address=/d1d95giojjkirt.cloudfront.net/0.0.0.0
address=/d1ep3cn6qx0l3z.cloudfront.net/0.0.0.0
address=/d1ey3fksimezm4.cloudfront.net/0.0.0.0
address=/d1fo96xm8fci0r.cloudfront.net/0.0.0.0
address=/d1gojtoka5qi10.cloudfront.net/0.0.0.0
address=/d1k74lgicilrr3.cloudfront.net/0.0.0.0
address=/d1noellhv8fksc.cloudfront.net/0.0.0.0
address=/d1pcttwib15k25.cloudfront.net/0.0.0.0
address=/d1pdpbxj733bb1.cloudfront.net/0.0.0.0
address=/d1spb7fplenrp4.cloudfront.net/0.0.0.0
address=/d1vbm0eveofcle.cloudfront.net/0.0.0.0
address=/d1zgderxoe1a.cloudfront.net/0.0.0.0
address=/d23guct4biwna6.cloudfront.net/0.0.0.0
address=/d23nyyb6dc29z6.cloudfront.net/0.0.0.0
address=/d25ruj6ht8bs1.cloudfront.net/0.0.0.0
address=/d25xkbr68qqtcn.cloudfront.net/0.0.0.0
address=/d26dzd2k67we08.cloudfront.net/0.0.0.0
address=/d26j9bp9bq4uhd.cloudfront.net/0.0.0.0
address=/d26wy0pxd3qqpv.cloudfront.net/0.0.0.0
address=/d27jt7xr4fq3e8.cloudfront.net/0.0.0.0
address=/d287x05ve9a63s.cloudfront.net/0.0.0.0
address=/d29r6igjpnoykg.cloudfront.net/0.0.0.0
address=/d2anfhdgjxf8s1.cloudfront.net/0.0.0.0
address=/d2b2x1ywompm1b.cloudfront.net/0.0.0.0
address=/d2b65ihpmocv7w.cloudfront.net/0.0.0.0
address=/d2bgg7rjywcwsy.cloudfront.net/0.0.0.0
address=/d2cxkkxhecdzsq.cloudfront.net/0.0.0.0
address=/d2d2lbvq8xirbs.cloudfront.net/0.0.0.0
address=/d2dxgm96wvaa5j.cloudfront.net/0.0.0.0
address=/d2gpgaupalra1d.cloudfront.net/0.0.0.0
address=/d2gtlljtkeiyzd.cloudfront.net/0.0.0.0
address=/d2gz6iop9uxobu.cloudfront.net/0.0.0.0
address=/d2hap2bsh1k9lw.cloudfront.net/0.0.0.0
address=/d2ipklohrie3lo.cloudfront.net/0.0.0.0
address=/d2mic0r0bo3i6z.cloudfront.net/0.0.0.0
address=/d2mq0uzafv8ytp.cloudfront.net/0.0.0.0
address=/d2nlytvx51ywh9.cloudfront.net/0.0.0.0
address=/d2o307dm5mqftz.cloudfront.net/0.0.0.0
address=/d2oallm7wrqvmi.cloudfront.net/0.0.0.0
address=/d2omcicc3a4zlg.cloudfront.net/0.0.0.0
address=/d2pgy8h4i30on1.cloudfront.net/0.0.0.0
address=/d2plxos94peuwp.cloudfront.net/0.0.0.0
address=/d2r359adnh3sfn.cloudfront.net/0.0.0.0
address=/d2s64zaa9ua7uv.cloudfront.net/0.0.0.0
address=/d2tgev5wuprbqq.cloudfront.net/0.0.0.0
address=/d2tnimpzlb191i.cloudfront.net/0.0.0.0
address=/d2ubicnllnnszy.cloudfront.net/0.0.0.0
address=/d2ue9k1rhsumed.cloudfront.net/0.0.0.0
address=/d2v4glj2m8yzg5.cloudfront.net/0.0.0.0
address=/d2v9ajh2eysdau.cloudfront.net/0.0.0.0
address=/d2vt6q0n0iy66w.cloudfront.net/0.0.0.0
address=/d2yhukq7vldf1u.cloudfront.net/0.0.0.0
address=/d2z1smm3i01tnr.cloudfront.net/0.0.0.0
address=/d31807xkria1x4.cloudfront.net/0.0.0.0
address=/d32pxqbknuxsuy.cloudfront.net/0.0.0.0
address=/d33f10u0pfpplc.cloudfront.net/0.0.0.0
address=/d33otidwg56k90.cloudfront.net/0.0.0.0
address=/d34obr29voew8l.cloudfront.net/0.0.0.0
address=/d34rdvn2ky3gnm.cloudfront.net/0.0.0.0
address=/d37kzqe5knnh6t.cloudfront.net/0.0.0.0
address=/d38pxm3dmrdu6d.cloudfront.net/0.0.0.0
address=/d38r21vtgndgb1.cloudfront.net/0.0.0.0
address=/d39xqloz8t5a6x.cloudfront.net/0.0.0.0
address=/d3bvcf24wln03d.cloudfront.net/0.0.0.0
address=/d3dphmosjk9rot.cloudfront.net/0.0.0.0
address=/d3f9mcik999dte.cloudfront.net/0.0.0.0
address=/d3fzrm6pcer44x.cloudfront.net/0.0.0.0
address=/d3irruagotonpp.cloudfront.net/0.0.0.0
address=/d3iwjrnl4m67rd.cloudfront.net/0.0.0.0
address=/d3lvr7yuk4uaui.cloudfront.net/0.0.0.0
address=/d3lzezfa753mqu.cloudfront.net/0.0.0.0
address=/d3m41swuqq4sv5.cloudfront.net/0.0.0.0
address=/d3nvrqlo8rj1kw.cloudfront.net/0.0.0.0
address=/d3p9ql8flgemg7.cloudfront.net/0.0.0.0
address=/d3pkae9owd2lcf.cloudfront.net/0.0.0.0
address=/d3q2dpprdsteo.cloudfront.net/0.0.0.0
address=/d3qszud4qdthr8.cloudfront.net/0.0.0.0
address=/d3t2wca0ou3lqz.cloudfront.net/0.0.0.0
address=/d3t9ip55bsuxrf.cloudfront.net/0.0.0.0
address=/d3tdefw8pwfkbk.cloudfront.net/0.0.0.0
address=/d3vc1nm9xbncz5.cloudfront.net/0.0.0.0
address=/d5pvnbpawsaav.cloudfront.net/0.0.0.0
address=/d6bdy3eto8fyu.cloudfront.net/0.0.0.0
address=/d8qy7md4cj3gz.cloudfront.net/0.0.0.0
address=/dal9hkyfi0m0n.cloudfront.net/0.0.0.0
address=/dart.clearchannel.com/0.0.0.0
address=/dasfdasfasdf.no-ip.info/0.0.0.0
address=/data.neuroxmedia.com/0.0.0.0
address=/dbam.dashbida.com/0.0.0.0
address=/ddwht76d9jvfl.cloudfront.net/0.0.0.0
address=/dew9ckzjyt2gn.cloudfront.net/0.0.0.0
address=/dff7tx5c2qbxc.cloudfront.net/0.0.0.0
address=/display.digitalriver.com/0.0.0.0
address=/disy2s34euyqm.cloudfront.net/0.0.0.0
address=/dizixdllzznrf.cloudfront.net/0.0.0.0
address=/djlf5xdlz7m8m.cloudfront.net/0.0.0.0
address=/dkd69bwkvrht1.cloudfront.net/0.0.0.0
address=/dkdwv3lcby5zi.cloudfront.net/0.0.0.0
address=/dl392qndlveq0.cloudfront.net/0.0.0.0
address=/dl5v5atodo7gn.cloudfront.net/0.0.0.0
address=/dlupv9uqtjlie.cloudfront.net/0.0.0.0
address=/dm0acvguygm9h.cloudfront.net/0.0.0.0
address=/dm8srf206hien.cloudfront.net/0.0.0.0
address=/dp51h10v6ggpa.cloudfront.net/0.0.0.0
address=/dpsq2uzakdgqz.cloudfront.net/0.0.0.0
address=/dq2tgxnc2knif.cloudfront.net/0.0.0.0
address=/dqhi3ea93ztgv.cloudfront.net/0.0.0.0
address=/dr8pk6ovub897.cloudfront.net/0.0.0.0
address=/duct5ntjian71.cloudfront.net/0.0.0.0
address=/dvf2u7vwmkr5w.cloudfront.net/0.0.0.0
address=/dvt4pepo9om3r.cloudfront.net/0.0.0.0
address=/dx5qvhwg92mjd.cloudfront.net/0.0.0.0
address=/dxq6c0tx3v6mm.cloudfront.net/0.0.0.0
address=/dxqd86uz345mg.cloudfront.net/0.0.0.0
address=/dy48bnzanqw0v.cloudfront.net/0.0.0.0
address=/dycpc40hvg4ki.cloudfront.net/0.0.0.0
address=/dyl3p6so5yozo.cloudfront.net/0.0.0.0
address=/epowernetworktrackerimages.s3.amazonaws.com/0.0.0.0
address=/euwidget.imshopping.com/0.0.0.0
address=/events.kalooga.com/0.0.0.0
address=/ext.theglobalweb.com/0.0.0.0
address=/feeds.logicbuy.com/0.0.0.0
address=/ft.pnop.com/0.0.0.0
address=/gateway.fortunelounge.com/0.0.0.0
address=/gateways.s3.amazonaws.com/0.0.0.0
address=/geo.connexionsecure.com/0.0.0.0
address=/geobanner.friendfinder.com/0.0.0.0
address=/geobanner.passion.com/0.0.0.0
address=/gfaf-banners.s3.amazonaws.com/0.0.0.0
address=/homad-global-configs.schneevonmorgen.com/0.0.0.0
address=/im.ov.yahoo.co.jp/0.0.0.0
address=/ima3vpaid.appspot.com/0.0.0.0
address=/indieclick.3janecdn.com/0.0.0.0
address=/inskin.vo.llnwd.net/0.0.0.0
address=/k2team.kyiv.ua/0.0.0.0
address=/mads.aol.com/0.0.0.0
address=/marketing.888.com/0.0.0.0
address=/mb.zam.com/0.0.0.0
address=/mozo-widgets.f2.com.au/0.0.0.0
address=/network.aufeminin.com/0.0.0.0
address=/network.business.com/0.0.0.0
address=/oclasrv.comindex-2.htmlapu.php/0.0.0.0
address=/odin.goo.mx/0.0.0.0
address=/on.maxspeedcdn.com/0.0.0.0
address=/ox-i.cordillera.tv/0.0.0.0
address=/partner.bargaindomains.com/0.0.0.0
address=/partner.catchy.com/0.0.0.0
address=/partner.premiumdomains.com/0.0.0.0
address=/partnerads.ysm.yahoo.com/0.0.0.0
address=/partnerads1.ysm.yahoo.com/0.0.0.0
address=/partners.fshealth.com/0.0.0.0
address=/partners.optiontide.com/0.0.0.0
address=/partners.rochen.com/0.0.0.0
address=/partners.sportingbet.com.au/0.0.0.0
address=/partners.vouchedfor.co.uk/0.0.0.0
address=/partners.xpertmarket.com/0.0.0.0
address=/priceinfo.comuv.com/0.0.0.0
address=/promos.fling.com/0.0.0.0
address=/promote.pair.com/0.0.0.0
address=/promotions.iasbet.com/0.0.0.0
address=/pub.betclick.com/0.0.0.0
address=/pubs.hiddennetwork.com/0.0.0.0
address=/rack.bauermedia.co.uk/0.0.0.0
address=/res3.feedsportal.com/0.0.0.0
address=/revealads.appspot.com/0.0.0.0
address=/rotabanner.kulichki.net/0.0.0.0
address=/rotator.tradetracker.net/0.0.0.0
address=/s-yoolk-banner-assets.yoolk.com/0.0.0.0
address=/s-yoolk-billboard-assets.yoolk.com/0.0.0.0
address=/secretmedia.s3.amazonaws.com/0.0.0.0
address=/servedby.keygamesnetwork.com/0.0.0.0
address=/sitescout-video-cdn.edgesuite.net/0.0.0.0
address=/slot.union.ucweb.com/0.0.0.0
address=/smart.styria-digital.com/0.0.0.0
address=/squarespace.evyy.net/0.0.0.0
address=/stats.hosting24.com/0.0.0.0
address=/stats.sitesuite.org/0.0.0.0
address=/stuff-nzwhistleout.s3.amazonaws.com/0.0.0.0
address=/survey.g.doubleclick.net/0.0.0.0
address=/syndication.jsadapi.com/0.0.0.0
address=/syndication1.viraladnetwork.net/0.0.0.0
address=/tap.more-results.net/0.0.0.0
address=/ti.tradetracker.net/0.0.0.0
address=/track.bcvcmedia.com/0.0.0.0
address=/twinplan.com/0.0.0.0
address=/vendor1.fitschigogerl.com/0.0.0.0
address=/web-jp.ad-v.jp/0.0.0.0
address=/whistleout.s3.amazonaws.com/0.0.0.0
address=/widget.crowdignite.com/0.0.0.0
address=/widget.kelkoo.com/0.0.0.0
address=/widget.raaze.com/0.0.0.0
address=/widget.searchschoolsnetwork.com/0.0.0.0
address=/widget.shopstyle.com.au/0.0.0.0
address=/widget.solarquotes.com.au/0.0.0.0
address=/widgets.realestate.com.au/0.0.0.0
address=/wtpn.twenga.co.uk/0.0.0.0
address=/wtpn.twenga.de/0.0.0.0
address=/yb.torchbrowser.com/0.0.0.0
address=/yeas.yahoo.co.jp/0.0.0.0
address=/zapads.zapak.com/0.0.0.0
address=/zeus.qj.net/0.0.0.0
address=/iadc.qwapi.com/0.0.0.0
address=/d1nmk7iw7hajjn.cloudfront.net/0.0.0.0
address=/ad.duga.jp/0.0.0.0
address=/ad.iloveinterracial.com/0.0.0.0
address=/ads.videosz.com/0.0.0.0
address=/affiliates.thrixxx.com/0.0.0.0
address=/ard.sweetdiscreet.com/0.0.0.0
address=/bannershotlink.perfectgonzo.com/0.0.0.0
address=/blaaaa12.googlecode.com/0.0.0.0
address=/br.blackfling.com/0.0.0.0
address=/br.fling.com/0.0.0.0
address=/br.realitykings.com/0.0.0.0
address=/cpm.amateurcommunity.com/0.0.0.0
address=/dailyvideo.securejoin.com/0.0.0.0
address=/desk.cmix.org/0.0.0.0
address=/feeds.videosz.com/0.0.0.0
address=/ff.nsg.org.ua/0.0.0.0
address=/freexxxvideoclip.aebn.net/0.0.0.0
address=/geo.cliphunter.com/0.0.0.0
address=/geo.frtya.com/0.0.0.0
address=/geobanner.adultfriendfinder.com/0.0.0.0
address=/geobanner.alt.com/0.0.0.0
address=/geobanner.socialflirt.com/0.0.0.0
address=/partners.pornerbros.com/0.0.0.0
address=/s1magnettvcom.maynemyltf.netdna-cdn.com/0.0.0.0
address=/surv.xbizmedia.com/0.0.0.0
address=/sweet.game-rust.ru/0.0.0.0
address=/widgets.comcontent.net/0.0.0.0
address=/widgetssec.cam-content.com/0.0.0.0
address=/a.cdngeek.net/0.0.0.0
address=/a.clipconverter.cc/0.0.0.0
address=/a.giantrealm.com/0.0.0.0
address=/a.i-sgcm.com/0.0.0.0
address=/a.kat.cr/0.0.0.0
address=/a.kickass.to/0.0.0.0
address=/a.lolwot.com/0.0.0.0
address=/ac2.msn.com/0.0.0.0
address=/access.njherald.com/0.0.0.0
address=/ad.cooks.com/0.0.0.0
address=/ad.digitimes.com.tw/0.0.0.0
address=/ad.directmirror.com/0.0.0.0
address=/ad.download.cnet.com/0.0.0.0
address=/ad.evozi.com/0.0.0.0
address=/ad.fnnews.com/0.0.0.0
address=/ad.jamster.com/0.0.0.0
address=/ad.lyricswire.com/0.0.0.0
address=/ad.mangareader.net/0.0.0.0
address=/ad.newegg.com/0.0.0.0
address=/ad.pandora.tv/0.0.0.0
address=/ad.reachlocal.com/0.0.0.0
address=/ad.search.ch/0.0.0.0
address=/ad.services.distractify.com/0.0.0.0
address=/adcitrus.com/0.0.0.0
address=/addirector.vindicosuite.com/0.0.0.0
address=/adds.weatherology.com/0.0.0.0
address=/adlink.shopsafe.co.nz/0.0.0.0
address=/admeta.vo.llnwd.net/0.0.0.0
address=/ads-rolandgarros.com/0.0.0.0
address=/ads.pof.com/0.0.0.0
address=/ads.yahoo.com/0.0.0.0
address=/ads.zynga.com/0.0.0.0
address=/adsatt.abcnews.starwave.com/0.0.0.0
address=/adsatt.espn.starwave.com/0.0.0.0
address=/adshare.freedocast.com/0.0.0.0
address=/adsor.openrunner.com/0.0.0.0
address=/adss.yahoo.com/0.0.0.0
address=/adstil.indiatimes.com/0.0.0.0
address=/adtest.theonion.com/0.0.0.0
address=/advertise.twitpic.com/0.0.0.0
address=/advice-ads-cdn.vice.com/0.0.0.0
address=/adx.kat.ph/0.0.0.0
address=/aff.lmgtfy.com/0.0.0.0
address=/ajnad.aljazeera.net/0.0.0.0
address=/amz.steamprices.com/0.0.0.0
address=/analytics.mmosite.com/0.0.0.0
address=/as.inbox.com/0.0.0.0
address=/asd.projectfreetv.so/0.0.0.0
address=/avpa.dzone.com/0.0.0.0
address=/b.localpages.com/0.0.0.0
address=/b.thefile.me/0.0.0.0
address=/ba.ccm2.net/0.0.0.0
address=/ba.kioskea.net/0.0.0.0
address=/banner.automotiveworld.com/0.0.0.0
address=/banner.itweb.co.za/0.0.0.0
address=/banners.beevpn.com/0.0.0.0
address=/banners.beted.com/0.0.0.0
address=/banners.clubworldgroup.com/0.0.0.0
address=/banners.expressindia.com/0.0.0.0
address=/banners.i-comers.com/0.0.0.0
address=/banners.itweb.co.za/0.0.0.0
address=/banners.playocio.com/0.0.0.0
address=/beap.gemini.yahoo.com/0.0.0.0
address=/bizanti.youwatch.org/0.0.0.0
address=/bnrs.ilm.ee/0.0.0.0
address=/bwp.theinsider.com.com/0.0.0.0
address=/cadvv.heraldm.com/0.0.0.0
address=/cadvv.koreaherald.com/0.0.0.0
address=/canvas.thenextweb.com/0.0.0.0
address=/click.livedoor.com/0.0.0.0
address=/clicks.superpages.com/0.0.0.0
address=/cnetwidget.creativemark.co.uk/0.0.0.0
address=/collector.viki.io/0.0.0.0
address=/creatives.livejasmin.com/0.0.0.0
address=/d.annarbor.com/0.0.0.0
address=/d.businessinsider.com/0.0.0.0
address=/d.gossipcenter.com/0.0.0.0
address=/d.thelocal.com/0.0.0.0
address=/dads.new.digg.com/0.0.0.0
address=/dailydeals.amarillo.com/0.0.0.0
address=/dailydeals.augustachronicle.com/0.0.0.0
address=/dailydeals.brainerddispatch.com/0.0.0.0
address=/dailydeals.lubbockonline.com/0.0.0.0
address=/dailydeals.onlineathens.com/0.0.0.0
address=/dailydeals.savannahnow.com/0.0.0.0
address=/dcad.watersoul.com/0.0.0.0
address=/deals.ledgertranscript.com/0.0.0.0
address=/digdug.divxnetworks.com/0.0.0.0
address=/display.superbay.net/0.0.0.0
address=/dontblockme.modaco.com/0.0.0.0
address=/ehow.com/media/ad.html/0.0.0.0
address=/eva.ucas.com/0.0.0.0
address=/fan.twitch.tv/0.0.0.0
address=/fimserve.ign.com/0.0.0.0
address=/findnsave.idahostatesman.com/0.0.0.0
address=/g.brothersoft.com/0.0.0.0
address=/gameads.digyourowngrave.com/0.0.0.0
address=/geoshopping.nzherald.co.nz/0.0.0.0
address=/get.thefile.me/0.0.0.0
address=/gfx.infomine.com/0.0.0.0
address=/green.virtual-nights.com/0.0.0.0
address=/hejban.youwatch.org/0.0.0.0
address=/ibanners.empoweredcomms.com.au/0.0.0.0
address=/iframe.travel.yahoo.com/0.0.0.0
address=/imads.rediff.com/0.0.0.0
address=/kat-ads.torrenticity.com/0.0.0.0
address=/keepthelighton.vpsboard.com/0.0.0.0
address=/kermit.macnn.com/0.0.0.0
address=/life.imagepix.org/0.0.0.0
address=/ll.a.hulu.com/0.0.0.0
address=/londonprivaterentals.standard.co.uk/0.0.0.0
address=/looky.hyves.org/0.0.0.0
address=/lw2.gamecopyworld.com/0.0.0.0
address=/mads.dailymail.co.uk/0.0.0.0
address=/marketingsolutions.yahoo.com/0.0.0.0
address=/mb.hockeybuzz.com/0.0.0.0
address=/mealsandsteals.sandiego6.com/0.0.0.0
address=/media-delivery.armorgames.com/0.0.0.0
address=/media-mgmt.armorgames.com/0.0.0.0
address=/mediamgr.ugo.com/0.0.0.0
address=/nest.youwatch.org/0.0.0.0
address=/netspidermm.indiatimes.com/0.0.0.0
address=/network.sofeminine.co.uk/0.0.0.0
address=/noram.srv.ysm.yahoo.com/0.0.0.0
address=/oas.autotrader.co.uk/0.0.0.0
address=/oas.skyscanner.net/0.0.0.0
address=/oasc07.citywire.co.uk/0.0.0.0
address=/oascentral.chron.com/0.0.0.0
address=/oascentral.hosted.ap.org/0.0.0.0
address=/oascentral.newsmax.com/0.0.0.0
address=/ox-d.rantsports.com/0.0.0.0
address=/ox-d.sbnation.com/0.0.0.0
address=/ox-d.wetransfer.com/0.0.0.0
address=/ox.furaffinity.net/0.0.0.0
address=/partners-z.com/0.0.0.0
address=/photo.net/equipment/pg-160/0.0.0.0
address=/player.1800coupon.com/0.0.0.0
address=/player.1stcreditrepairs.com/0.0.0.0
address=/player.800directories.com/0.0.0.0
address=/player.accoona.com/0.0.0.0
address=/player.alloutwedding.com/0.0.0.0
address=/player.insuranceandhealth.com/0.0.0.0
address=/pmm.people.com.cn/0.0.0.0
address=/pop-over.powered-by.justplayzone.com/0.0.0.0
address=/prerollads.ign.com/0.0.0.0
address=/promo.fileforum.com/0.0.0.0
address=/rad.microsoft.com/0.0.0.0
address=/rad.msn.com/0.0.0.0
address=/red.bayimg.net/0.0.0.0
address=/redvase.bravenet.com/0.0.0.0
address=/richmedia.yimg.com/0.0.0.0
address=/roia.com/0.0.0.0
address=/rpt.anchorfree.net/0.0.0.0
address=/searchignited.com/0.0.0.0
address=/sebar.thand.info/0.0.0.0
address=/shoppingpartners2.futurenet.com/0.0.0.0
address=/sponsors.s2ki.com/0.0.0.0
address=/sponsors.webosroundup.com/0.0.0.0
address=/srv.thespacereporter.com/0.0.0.0
address=/storewidget.pcauthority.com.au/0.0.0.0
address=/stream.heavenmedia.net/0.0.0.0
address=/tanzanite.infomine.com/0.0.0.0
address=/targetedinfo.com/0.0.0.0
address=/targetedtopic.com/0.0.0.0
address=/thejesperbay.com/0.0.0.0
address=/themis.yahoo.com/0.0.0.0
address=/tmcs.net/0.0.0.0
address=/tom.itv.com/0.0.0.0
address=/tracking.hostgator.com/0.0.0.0
address=/ua.badongo.com/0.0.0.0
address=/uimserv.net/0.0.0.0
address=/unicast.ign.com/0.0.0.0
address=/unicast.msn.com/0.0.0.0
address=/verdict.abc.go.com/0.0.0.0
address=/vice-ads-cdn.vice.com/0.0.0.0
address=/w.homes.yahoo.net/0.0.0.0
address=/webmaster.extabit.com/0.0.0.0
address=/widget.directory.dailycommercial.com/0.0.0.0
address=/x.castanet.net/0.0.0.0
address=/yea.uploadimagex.com/0.0.0.0
address=/yesbeby.whies.info/0.0.0.0
address=/yrt7dgkf.exashare.com/0.0.0.0
address=/ysm.yahoo.com/0.0.0.0
address=/zads.care2.com/0.0.0.0
address=/a.eporner.com/0.0.0.0
address=/a.heavy-r.com/0.0.0.0
address=/a.killergram-girls.com/0.0.0.0
address=/ad.eporner.com/0.0.0.0
address=/ad.slutload.com/0.0.0.0
address=/ad.thisav.com/0.0.0.0
address=/ad.userporn.com/0.0.0.0
address=/ads.xxxbunker.com/0.0.0.0
address=/affiliates.goodvibes.com/0.0.0.0
address=/banner1.pornhost.com/0.0.0.0
address=/banners.cams.com/0.0.0.0
address=/bob.crazyshit.com/0.0.0.0
address=/brcache.madthumbs.com/0.0.0.0
address=/creatives.cliphunter.com/0.0.0.0
address=/creatives.pichunter.com/0.0.0.0
address=/dot.eporner.com/0.0.0.0
address=/dot2.eporner.com/0.0.0.0
address=/exit.macandbumble.com/0.0.0.0
address=/lw1.cdmediaworld.com/0.0.0.0
address=/m2.xhamster.com/0.0.0.0
address=/partners.xhamster.com/0.0.0.0
address=/pr-static.empflix.com/0.0.0.0
address=/pr-static.tnaflix.com/0.0.0.0
address=/r.radikal.ru/0.0.0.0
address=/rev.fapdu.com/0.0.0.0
address=/site.img.4tube.com/0.0.0.0
address=/static.kinghost.com/0.0.0.0
address=/x.eroticity.net/0.0.0.0
address=/x.vipergirls.to/0.0.0.0

View File

@ -0,0 +1,4 @@
address=/p.tanx.com/0.0.0.0
address=/googlesyndication.com/0.0.0.0
address=/linkvans.com/0.0.0.0
server=/valf.atm.youku.com/114.114.114.114

View File

@ -0,0 +1,3 @@
ipset=/weixin.qq.com/adbyby_wan
ipset=/qpic.cn/adbyby_wan
ipset=/imtt.qq.com/adbyby_wan

View File

@ -0,0 +1,16 @@
#!/bin/sh
if [ -f /tmp/blockip.ipset ];then
adbyby_enable=$(uci get adbyby.@adbyby[0].enable)
if [ $adbyby_enable -eq 1 ]; then
if pidof adbyby>/dev/null; then
/etc/init.d/adbyby reload_rule
else
/etc/init.d/adbyby restart
fi
fi
fi

View File

@ -0,0 +1,15 @@
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
! -------------- 规则基于abp规则并进行了字符替换部分的扩展-----------------------------
! ABP规则请参考https://adblockplus.org/zh_CN/filters下面为大致摘要
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
! "*" 为字符通配符能够匹配0长度或任意长度的字符串该通配符不能与正则语法混用。
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
! "|" 为管线符号,来表示地址的最前端或最末端
! "||" 为子域通配符,方便匹配主域名下的所有子域。
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
! "##" 为元素选择器标识符后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
!! 元素隐藏暂不支持全局规则和排除规则
!! 字符替换扩展
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
! 支持通配符*和?
! -------------------------------------------------------------------------------------------

View File

@ -0,0 +1,19 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for Aliddns
LUCI_DEPENDS:=+wget +openssl-util
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,4 @@
module("luci.controller.aliddns",package.seeall)
function index()
entry({"admin","services","aliddns"},cbi("aliddns"),_("Aliddns Client"),101)
end

View File

@ -0,0 +1,52 @@
local a=require"luci.sys"
local e=luci.model.uci.cursor()
local e=require"nixio.fs"
require("luci.sys")
local t,e,o
local m,s
t=Map("aliddns",translate("阿里DDNS客户端"),translate("基于阿里云解析的私人DDNS解决方案"))
e=t:section(TypedSection,"base")
e.anonymous=true
e:tab("basic", translate("设置"))
enable=e:taboption("basic",Flag,"enable",translate("开启"),translate("开启或关闭aliddns动态域名"))
enable.rmempty=false
token=e:taboption("basic",Value,"app_key",translate("APP KEY"))
email=e:taboption("basic",Value,"app_secret",translate("APP SECRET"))
iface=e:taboption("basic",ListValue,"interface",translate("选择外网接口"),translate("限定要动态aliddns的外网接口如pppoe-wan"))
iface:value("",translate("选择要动态更新的外网接口"))
for t,e in ipairs(a.net.devices())do
if e~="lo"then iface:value(e)end
end
iface.rmempty=false
main=e:taboption("basic",Value,"main_domain",translate("主域名"),"想要解析的主域名,例如:baidu.com")
main.rmempty=false
sub=e:taboption("basic",Value,"sub_domain",translate("子域名"),"想要解析的子域名,例如:test hehe")
sub.rmempty=false
time=e:taboption("basic",Value,"time",translate("检查时间"),"域名检查时间单位分钟范围1-59")
time.rmempty=false
e:tab("log", translate("更新记录"))
--e=t:section(TypedSection,"base",translate("更新记录"))
e.anonymous=true
local a="/var/log/aliddns.log"
tvlog=e:taboption("log",TextValue,"sylogtext")
tvlog.rows=14
tvlog.readonly="readonly"
tvlog.wrap="off"
function tvlog.cfgvalue(e,e)
sylogtext=""
if a and nixio.fs.access(a)then
sylogtext=luci.sys.exec("tail -n 100 %s"%a)
end
return sylogtext
end
tvlog.write=function(e,e,e)
end
local e=luci.http.formvalue("cbi.apply")
if e then
io.popen("/etc/init.d/aliddns restart")
end
return t

View File

@ -0,0 +1,4 @@
msgid "Aliddns Client"
msgstr "阿里DDNS客户端"

View File

@ -0,0 +1,10 @@
config base 'base'
option time '30'
option enable '0'
option app_key '1'
option app_secret '1'
option interface 'br-lan'
option main_domain '1.com'
option sub_domain '2'

View File

@ -0,0 +1,18 @@
#!/bin/sh /etc/rc.common
START=80
restart()
{
/usr/sbin/aliddns
}
start()
{
/usr/sbin/aliddns
}
stop()
{
/usr/sbin/aliddns
}

View File

@ -0,0 +1,5 @@
#!/bin/sh
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,128 @@
#!/bin/sh
aliddns_ak=`uci get aliddns.base.app_key 2>/dev/null`
aliddns_sk=`uci get aliddns.base.app_secret 2>/dev/null`
aliddns_record_id=`uci get aliddns.base.record_id 2>/dev/null`
time=`uci get aliddns.base.time 2>/dev/null`
aliddns_enable=`uci get aliddns.base.enable`
aliddns_domain=`uci get aliddns.base.main_domain 2>/dev/null`
aliddns_name=`uci get aliddns.base.sub_domain 2>/dev/null`
interface=`uci get aliddns.base.interface 2>/dev/null`
DATE=$(date +'%Y-%m-%d %H:%M:%S')
timestamp=`date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ"`
ip=$(ifconfig $interface 2> /dev/null | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null)
check_aliddns() {
#ip=`wget -qO- http://whatismyip.akamai.com/ 2>/dev/null`
#current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null`
current_ip=`echo $query_result | sed 's/.*,"Value":"\([0-9\.]*\)",.*/\1/'`
echo "$DATE 当前路由IP: ${ip}" >> /var/log/aliddns.log
echo "$DATE 远程解析IP: ${current_ip}" >> /var/log/aliddns.log
if [ "$ip" = "$current_ip" ]
then
echo "$DATE IP未改变无需更新" >> /var/log/aliddns.log
exit 0
else
echo "$DATE 更新中..." >> /var/log/aliddns.log
fi
}
urlencode() {
# urlencode <string>
local length="${#1}"
i=0
out=""
for i in $(awk "BEGIN { for ( i=0; i<$length; i++ ) { print i; } }")
do
local c="${1:$i:1}"
case $c in
[a-zA-Z0-9._-]) out="$out$c" ;;
*) out="$out`printf '%%%02X' "'$c"`" ;;
esac
i=$(($i + 1))
done
echo -n $out
}
send_request() {
local args="AccessKeyId=$aliddns_ak&Action=$1&Format=json&$2&Version=2015-01-09"
local hash=$(urlencode $(echo -n "GET&%2F&$(urlencode $args)" | openssl dgst -sha1 -hmac "$aliddns_sk&" -binary | openssl base64))
wget -qO- "http://alidns.aliyuncs.com/?$args&Signature=$hash" 2> /dev/null
}
get_recordid() {
grep -Eo '"RecordId":"[0-9]+"' | cut -d':' -f2 | tr -d '"'
}
query_recordid() {
send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$(urlencode "$aliddns_name").$aliddns_domain&Timestamp=$timestamp"
}
update_record() {
send_request "UpdateDomainRecord" "RR=$(urlencode "$aliddns_name")&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
add_record() {
send_request "AddDomainRecord&DomainName=$aliddns_domain" "RR=$(urlencode "$aliddns_name")&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip"
}
go_record() {
if [ "$aliddns_record_id" = "" ]
then
aliddns_record_id=`echo $query_result | get_recordid`
fi
if [ "$aliddns_record_id" = "" ]
then
aliddns_record_id=`add_record | get_recordid`
echo "$DATE 添加 record $aliddns_record_id" >> /var/log/aliddns.log
else
update_record $aliddns_record_id
echo "$DATE 更新 record $aliddns_record_id" >> /var/log/aliddns.log
fi
# save to file
if [ "$aliddns_record_id" = "" ]; then
# failed
echo "$DATE : 更新出错,请检查设置!" >> /var/log/aliddns.log
exit 0
else
uci set aliddns.base.record_id=$aliddns_record_id
uci commit
echo "$DATE : 更新成功!($ip)" >> /var/log/aliddns.log
fi
}
#将执行脚本写入crontab定时运行
add_aliddns_cru(){
wirtecron=$(cat /etc/crontabs/root | grep "$time * * * *" | grep aliddns)
if [ -z "$wirtecron" ];then
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
echo "*/$time * * * * /usr/sbin/aliddns" >> /etc/crontabs/root
fi
}
#清除过多记录
clean_log(){
logrow=$(grep -c "" /var/log/aliddns.log)
if [ $logrow -ge 15 ];then
cat /dev/null > /var/log/aliddns.log
echo "$DATE Log条数超限清空处理" >> /var/log/aliddns.log
fi
}
#停止服务
stop_aliddns(){
#停掉cru里的任务
sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1
}
if [ "$aliddns_enable" != "1" ]; then
stop_aliddns
echo "$DATE : aliddns没有开启" >> /var/log/aliddns.log
else
clean_log
query_result=$(query_recordid)
check_aliddns
go_record
add_aliddns_cru
fi

View File

@ -0,0 +1,17 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Scheduled Reboot
LUCI_DEPENDS:=+luci
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=8
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,4 @@
module("luci.controller.autoreboot",package.seeall)
function index()
entry({"admin","system","autoreboot"},cbi("autoreboot"),_("Scheduled Reboot"),88)
end

View File

@ -0,0 +1,38 @@
require("luci.sys")
m=Map("autoreboot",translate("Scheduled Reboot"),translate("Scheduled reboot Setting"))
s=m:section(TypedSection,"login","")
s.addremove=false
s.anonymous=true
enable=s:option(Flag,"enable",translate("Enable"))
enable.rmempty = false
enable.default=0
week=s:option(ListValue,"week",translate("Week Day"))
week:value(0,translate("Everyday"))
week:value(1,translate("Monday"))
week:value(2,translate("Tuesday"))
week:value(3,translate("Wednesday"))
week:value(4,translate("Thursday"))
week:value(5,translate("Friday"))
week:value(6,translate("Saturday"))
week:value(7,translate("Sunday"))
week.default=0
hour=s:option(Value,"hour",translate("Hour"))
hour.datatype = "range(0,23)"
hour.rmempty = false
pass=s:option(Value,"minute",translate("Minute"))
pass.datatype = "range(0,59)"
pass.rmempty = false
local e=luci.http.formvalue("cbi.apply")
if e then
io.popen("/etc/init.d/autoreboot restart")
end
return m

View File

@ -0,0 +1,25 @@
msgid "Scheduled Reboot"
msgstr "定时重启"
msgid "Scheduled reboot Setting"
msgstr "定时重启设置"
msgid "Week Day"
msgstr "星期"
msgid "Everyday"
msgstr "每天"
msgid "Day"
msgstr "天"
msgid "Hour"
msgstr "小时"
msgid "Minute"
msgstr "分钟"

View File

@ -0,0 +1,7 @@
config login
option minute '0'
option hour '5'
option week '3'
option enable '0'

View File

@ -0,0 +1,39 @@
#!/bin/sh /etc/rc.common
START=50
run_reboot()
{
local enable
config_get_bool enable $1 enable
if [ $enable = 1 ]; then
local minute
local hour
config_get week $1 week
config_get minute $1 minute
config_get hour $1 hour
if [ $minute = 0 ] ; then
minute="00"
fi
if [ $week = 0 ] ; then
week="*"
fi
sed -i '/reboot/d' /etc/crontabs/root >/dev/null 2>&1
echo "$minute $hour * * $week sleep 5 && touch /etc/banner && reboot" >> /etc/crontabs/root
echo "Auto REBOOT has started."
else
sed -i '/reboot/d' /etc/crontabs/root >/dev/null 2>&1
echo "Auto REBOOT has started."
fi
}
start()
{
config_load autoreboot
config_foreach run_reboot login
}
stop()
{
echo "Auto REBOOT has stoped."
}

View File

@ -0,0 +1,18 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI page for IPK upload
LUCI_DEPENDS:=+luci-lib-fs
PKG_VERSION:=1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

Some files were not shown because too many files have changed in this diff Show More