forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09e34de
commit 91217e1
Showing
11 changed files
with
5,763 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# | ||
# Copyright (C) 2017 adbyby-ram | ||
# Copyright (C) 2017 yushi studio <[email protected]> | ||
# | ||
# This is free software, licensed under the GNU General Public License v3. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=adbyby-ram | ||
PKG_VERSION:=1.0 | ||
|
||
|
||
PKG_LICENSE:=GPLv3 | ||
PKG_LICENSE_FILES:=LICENSE | ||
PKG_MAINTAINER:=yushi studio <[email protected]> | ||
|
||
|
||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/luci-app-adbyby-ram | ||
SECTION:=luci | ||
CATEGORY:=LuCI | ||
SUBMENU:=3. Applications | ||
TITLE:=adbyby-ram LuCI interface | ||
URL:=https://github.com/ywb94/adbyby-ram | ||
PKGARCH:=all | ||
endef | ||
|
||
define Package/luci-app-adbyby-ram/description | ||
LuCI Support for adbyby-ram. | ||
endef | ||
|
||
define Build/Prepare | ||
$(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \ | ||
po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) | ||
endef | ||
|
||
define Build/Configure | ||
endef | ||
|
||
define Build/Compile | ||
endef | ||
|
||
define Package/luci-app-adbyby-ram/prerm | ||
#!/bin/sh | ||
# check if we are on real system | ||
if [ -z "$${IPKG_INSTROOT}" ]; then | ||
/etc/init.d/adbyby_ram disable | ||
/etc/init.d/adbyby_ram stop | ||
fi | ||
exit 0 | ||
endef | ||
|
||
|
||
|
||
|
||
|
||
|
||
define Package/luci-app-adbyby-ram/postinst | ||
#!/bin/sh | ||
if [ -z "$${IPKG_INSTROOT}" ]; then | ||
chmod 755 /etc/init.d/adbyby_ram >/dev/null 2>&1 | ||
/etc/init.d/adbyby_ram enable >/dev/null 2>&1 | ||
fi | ||
exit 0 | ||
endef | ||
|
||
ifeq ($(ARCH),mips) | ||
define Package/luci-app-adbyby-ram/install | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller | ||
$(INSTALL_DATA) ./files/luci/controller/adbyby.lua $(1)/usr/lib/lua/luci/controller/adbyby.lua | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n | ||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/adbyby.*.lmo $(1)/usr/lib/lua/luci/i18n | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi | ||
$(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ | ||
$(INSTALL_DIR) $(1)/usr/bin | ||
$(INSTALL_BIN) ./files/adbyby_ar71xx.sh $(1)/usr/bin/adbyby.sh | ||
$(INSTALL_DIR) $(1)/etc/config | ||
$(INSTALL_DATA) ./files/adbyby.config $(1)/etc/config/adbyby | ||
$(INSTALL_DIR) $(1)/etc/init.d | ||
$(INSTALL_BIN) ./files/adbyby.init $(1)/etc/init.d/adbyby_ram | ||
endef | ||
endif | ||
|
||
ifeq ($(ARCH),mipsel) | ||
define Package/luci-app-adbyby-ram/install | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller | ||
$(INSTALL_DATA) ./files/luci/controller/adbyby.lua $(1)/usr/lib/lua/luci/controller/adbyby.lua | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n | ||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/adbyby.*.lmo $(1)/usr/lib/lua/luci/i18n | ||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi | ||
$(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ | ||
$(INSTALL_DIR) $(1)/usr/bin | ||
$(INSTALL_BIN) ./files/adbyby_ramips.sh $(1)/usr/bin/adbyby.sh | ||
$(INSTALL_DIR) $(1)/etc/config | ||
$(INSTALL_DATA) ./files/adbyby.config $(1)/etc/config/adbyby | ||
$(INSTALL_DIR) $(1)/etc/init.d | ||
$(INSTALL_BIN) ./files/adbyby.init $(1)/etc/init.d/adbyby_ram | ||
endef | ||
endif | ||
|
||
$(eval $(call BuildPackage,luci-app-adbyby-ram)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
config adbyby 'adbyby' | ||
option enable '0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
###################################################################### | ||
# | ||
# Function : Run adbyby in RAM | ||
# | ||
# Creater : [email protected], 2017-02-16 | ||
# | ||
# Copyright : yushi studio | ||
# | ||
###################################################################### | ||
|
||
START=80 | ||
|
||
|
||
start() { | ||
/etc/init.d/adbyby_ram enabled | ||
if [ $? == 1 ]; then | ||
return | ||
fi | ||
#不重复启动 | ||
icount=`ps -w|grep adbyby.sh|grep -v grep|wc -l` | ||
icount2=`netstat -nautp|grep adbyby|grep -v grep|wc -l` | ||
|
||
if [ $icount = 0 -a $icount2 = 0 ] ;then | ||
/usr/bin/adbyby.sh & | ||
fi | ||
|
||
} | ||
|
||
stop() { | ||
#确保清除防火墙规则 | ||
i=0 | ||
icount=`iptables -t nat -L|grep "ports 8118"|wc -l` | ||
while [ $i -le 10 -a $icount -gt 1 ] | ||
do | ||
let i=i+1 | ||
iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8118 | ||
icount=`iptables -t nat -L|grep "ports 8118"|wc -l` | ||
done | ||
|
||
|
||
if [ -f /tmp/adbyby/bin/stopadbb ] ;then | ||
cd /tmp/adbyby/bin | ||
./stopadbb 2>/dev/null | ||
fi | ||
|
||
icount=`ps -w|grep adbyby.sh|grep -v grep|wc -l` | ||
if [ $icount -gt 0 ] ;then | ||
mid=`ps -w|grep adbyby.sh|grep -v grep|awk '{print $1}'` | ||
kill -9 $mid | ||
fi | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
cd /tmp | ||
#等待网络连接成功 | ||
wget_ok="0" | ||
#rm -f 7620n.tar.gz | ||
rm -f ar71xx.tar.gz | ||
|
||
while [ "$wget_ok" = "0" ] | ||
do | ||
#wget http://update.adbyby.com/download/7620n.tar.gz | ||
wget http://update.adbyby.com/download/ar71xx.tar.gz | ||
if [ "$?" == "0" ]; then | ||
wget_ok="1" | ||
else | ||
sleep 30 | ||
fi | ||
done | ||
#解压、启动adbyby | ||
mkdir -p adbyby | ||
#tar -zvxf 7620n.tar.gz -C ./adbyby | ||
tar -zvxf ar71xx.tar.gz -C ./adbyby | ||
|
||
#更新一次规则 | ||
murl=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $1}'` | ||
|
||
if [ ${#murl} -gt 5 ] ;then | ||
murl2=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $2}'` | ||
mfile="/tmp/adbyby/bin"${murl2//\\//} | ||
wget $murl -O $mfile | ||
fi | ||
|
||
murl=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $1}'` | ||
if [ ${#murl} -gt 5 ] ;then | ||
murl2=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $2}'` | ||
mfile="/tmp/adbyby/bin"${murl2//\\//} | ||
wget $murl -O $mfile | ||
fi | ||
|
||
murl=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $1}'` | ||
if [ ${#murl} -gt 5 ] ;then | ||
murl2=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $2}'` | ||
mfile="/tmp/adbyby/bin"${murl2//\\//} | ||
wget $murl -O $mfile | ||
fi | ||
|
||
|
||
cd ./adbyby/bin | ||
./startadbb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/sh | ||
cd /tmp | ||
#等待网络连接成功 | ||
wget_ok="0" | ||
rm -f 7620n.tar.gz | ||
#rm -f ar71xx.tar.gz | ||
|
||
while [ "$wget_ok" = "0" ] | ||
do | ||
wget http://update.adbyby.com/download/7620n.tar.gz | ||
#wget http://update.adbyby.com/download/ar71xx.tar.gz | ||
if [ "$?" == "0" ]; then | ||
wget_ok="1" | ||
else | ||
sleep 30 | ||
fi | ||
done | ||
#解压、启动adbyby | ||
mkdir -p adbyby | ||
tar -zvxf 7620n.tar.gz -C ./adbyby | ||
#tar -zvxf ar71xx.tar.gz -C ./adbyby | ||
|
||
#更新一次规则 | ||
murl=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $1}'` | ||
|
||
if [ ${#murl} -gt 5 ] ;then | ||
murl2=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $2}'` | ||
mfile="/tmp/adbyby/bin"${murl2//\\//} | ||
wget $murl -O $mfile | ||
fi | ||
|
||
murl=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $1}'` | ||
if [ ${#murl} -gt 5 ] ;then | ||
murl2=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $2}'` | ||
mfile="/tmp/adbyby/bin"${murl2//\\//} | ||
wget $murl -O $mfile | ||
fi | ||
|
||
murl=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $1}'` | ||
if [ ${#murl} -gt 5 ] ;then | ||
murl2=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $2}'` | ||
mfile="/tmp/adbyby/bin"${murl2//\\//} | ||
wget $murl -O $mfile | ||
fi | ||
|
||
cd ./adbyby/bin | ||
./startadbb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
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"), 20) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
msgid "" | ||
msgstr "Content-Type: text/plain; charset=UTF-8\n" | ||
|
||
msgid "Not exist" | ||
msgstr "不存在" | ||
|
||
msgid "AD Block" | ||
msgstr "广告屏蔽" | ||
|
||
msgid "Disable" | ||
msgstr "停用" | ||
|
||
msgid "Enable" | ||
msgstr "启用" | ||
|
||
msgid "Running Status" | ||
msgstr "运行状态" | ||
|
||
msgid "Lazy rules time" | ||
msgstr "Lazy规则日期" | ||
|
||
msgid "Video rules time" | ||
msgstr "Video规则日期" | ||
|
||
msgid "Running" | ||
msgstr "运行中" | ||
|
||
msgid "Not Running" | ||
msgstr "未运行" | ||
|
||
msgid "Wait Connect.." | ||
msgstr "等待联网" | ||
|
||
msgid "Enable Adbyby" | ||
msgstr "是否启用Adbyby" | ||
|
||
msgid "Adbyby" | ||
msgstr "广告屏蔽" |
Oops, something went wrong.