mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
package: add verysync and luci-app-verysync
This commit is contained in:
parent
a05d3418ca
commit
6bc798ce6e
17
package/lean/luci-app-verysync/Makefile
Normal file
17
package/lean/luci-app-verysync/Makefile
Normal 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 Verysync
|
||||
LUCI_DEPENDS:=+luci
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
@ -0,0 +1,18 @@
|
||||
|
||||
module("luci.controller.verysync", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/verysync") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "nas", "verysync"}, cbi("verysync"), _("Verysync"), 10).dependent = true
|
||||
entry({"admin","nas","verysync","status"},call("act_status")).leaf=true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep verysync >/dev/null")==0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
20
package/lean/luci-app-verysync/luasrc/model/cbi/verysync.lua
Normal file
20
package/lean/luci-app-verysync/luasrc/model/cbi/verysync.lua
Normal file
@ -0,0 +1,20 @@
|
||||
-- Copyright 2008 Yanira <forum-2008@email.de>
|
||||
-- Licensed to the public under the Apache License 2.0.
|
||||
|
||||
require("nixio.fs")
|
||||
|
||||
m = Map("verysync", translate("An Efficient Data Transfer Tool"),
|
||||
translate("Simple and easy-to-use multi-platform file synchronization software, astonishing transmission speed is different from the greatest advantage of other products, micro-force synchronization of intelligent P2P technology to accelerate synchronization, will split the file into several KB-only data synchronization, and the file will be AES encryption processing."))
|
||||
|
||||
m:section(SimpleSection).template = "verysync/verysync_status"
|
||||
|
||||
s = m:section(TypedSection, "setting", translate("Settings"))
|
||||
s.anonymous = true
|
||||
|
||||
s:option(Flag, "enabled", translate("Enable"))
|
||||
|
||||
s:option(Value, "port", translate("port")).default = 8886
|
||||
s.rmempty = true
|
||||
|
||||
|
||||
return m
|
@ -0,0 +1,22 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(1, '<%=url([[admin]], [[nas]], [[verysync]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('verysync_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<font color=green><%:RUNNING%></font>';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<font color=red><%:NOT RUNNING%></font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="verysync_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
13
package/lean/luci-app-verysync/po/zh-cn/verysync.po
Normal file
13
package/lean/luci-app-verysync/po/zh-cn/verysync.po
Normal file
@ -0,0 +1,13 @@
|
||||
msgid "Verysync"
|
||||
msgstr "微力同步"
|
||||
|
||||
msgid "An Efficient Data Transfer Tool"
|
||||
msgstr "一款高效的数据传输工具"
|
||||
|
||||
msgid "Simple and easy-to-use multi-platform file synchronization software, astonishing transmission speed is different from the greatest advantage of other products, micro-force synchronization of intelligent P2P technology to accelerate synchronization, will split the file into several KB-only data synchronization, and the file will be AES encryption processing."
|
||||
msgstr "简单易用的多平台文件同步软件,惊人的传输速度是不同于其他产品的最大优势, 微力同步 的智能 P2P 技术加速同步,会将文件分割成若干份仅 KB 的数据同步,而文件都会进行 AES 加密处理。"
|
||||
|
||||
|
||||
|
||||
|
||||
|
4
package/lean/luci-app-verysync/root/etc/config/verysync
Normal file
4
package/lean/luci-app-verysync/root/etc/config/verysync
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
config setting 'config'
|
||||
option enabled '0'
|
||||
option port '8886'
|
43
package/lean/luci-app-verysync/root/etc/init.d/verysync
Executable file
43
package/lean/luci-app-verysync/root/etc/init.d/verysync
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
START=50
|
||||
|
||||
run_verysync()
|
||||
{
|
||||
local enabled
|
||||
config_get_bool enabled $1 enabled
|
||||
if [ $enabled = 1 ]; then
|
||||
local port
|
||||
config_get port $1 port
|
||||
state=`pgrep verysync | wc -l`
|
||||
if [ $state = 0 ] ; then
|
||||
export HOME="/root"
|
||||
verysync -gui-address="0.0.0.0:$port" -logfile="/var/log/verysync.log" -no-browser >/dev/null &
|
||||
echo "启动中..."
|
||||
start=`pgrep verysync | wc -l`
|
||||
if [ $start = 0 ] ; then
|
||||
echo "启动失败"
|
||||
else
|
||||
echo "启动成功"
|
||||
fi
|
||||
else
|
||||
echo "已在运行"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
config_load verysync
|
||||
config_foreach run_verysync setting
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
kill -9 `pgrep verysync`
|
||||
stop=`pgrep verysync | wc -l`
|
||||
if [ $stop = 0 ] ; then
|
||||
echo "已停止运行"
|
||||
else
|
||||
echo "未停止运行"
|
||||
fi
|
||||
}
|
12
package/lean/luci-app-verysync/root/etc/uci-defaults/luci-verysync
Executable file
12
package/lean/luci-app-verysync/root/etc/uci-defaults/luci-verysync
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
touch /etc/config/verysync
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@verysync[-1]
|
||||
add ucitrack verysync
|
||||
set ucitrack.@verysync[-1].exec='/etc/init.d/verysync restart'
|
||||
commit ucitrack
|
||||
EOF
|
||||
# remove LuCI cache
|
||||
rm -f /tmp/luci*
|
||||
exit 0
|
BIN
package/lean/luci-app-verysync/root/usr/bin/verysync
Normal file
BIN
package/lean/luci-app-verysync/root/usr/bin/verysync
Normal file
Binary file not shown.
71
package/lean/verysync/Makefile
Normal file
71
package/lean/verysync/Makefile
Normal file
@ -0,0 +1,71 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
PKG_ARCH_VERYSYNC:=amd64
|
||||
endif
|
||||
ifeq ($(ARCH),mipsel)
|
||||
PKG_ARCH_VERYSYNC:=mipsle
|
||||
endif
|
||||
ifeq ($(ARCH),mips)
|
||||
PKG_ARCH_VERYSYNC:=mips
|
||||
endif
|
||||
ifeq ($(ARCH),i386)
|
||||
PKG_ARCH_VERYSYNC:=386
|
||||
endif
|
||||
ifeq ($(ARCH),arm)
|
||||
PKG_ARCH_VERYSYNC:=arm
|
||||
endif
|
||||
ifeq ($(BOARD),bcm53xx)
|
||||
PKG_ARCH_VERYSYNC:=arm6
|
||||
endif
|
||||
ifeq ($(BOARD),kirkwood)
|
||||
PKG_ARCH_VERYSYNC:=arm
|
||||
endif
|
||||
ifeq ($(ARCH),aarch64)
|
||||
PKG_ARCH_VERYSYNC:=arm64
|
||||
endif
|
||||
|
||||
PKG_NAME:=verysync
|
||||
PKG_VERSION:=v1.2.4
|
||||
PKG_RELEASE:=2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-linux-$(PKG_ARCH_VERYSYNC)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://releases-cdn.verysync.com/releases/$(PKG_VERSION)/
|
||||
PKG_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A efficient data transmission tool
|
||||
DEPENDS:=
|
||||
URL:=http://www.verysync.com
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Verysync is a efficient data transmission tool.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
tar -xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME)-linux-$(PKG_ARCH_VERYSYNC)-$(PKG_VERSION)/verysync $(1)/usr/bin/verysync
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
Loading…
Reference in New Issue
Block a user