mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-15 18:03:30 +00:00
add ssrr kms package
This commit is contained in:
parent
ab8216ce32
commit
1fa3b75271
16
package/lean/luci-app-kms/Makefile
Normal file
16
package/lean/luci-app-kms/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# 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 KMS
|
||||
LUCI_DEPENDS:=+vlmcsd
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
11
package/lean/luci-app-kms/luasrc/controller/vlmcsd.lua
Normal file
11
package/lean/luci-app-kms/luasrc/controller/vlmcsd.lua
Normal file
@ -0,0 +1,11 @@
|
||||
module("luci.controller.vlmcsd", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/vlmcsd") then
|
||||
return
|
||||
end
|
||||
local page
|
||||
page = entry({"admin", "services", "vlmcsd"}, cbi("vlmcsd"), _("KMS Server"), 100)
|
||||
page.i18n = "vlmcsd"
|
||||
page.dependent = true
|
||||
end
|
65
package/lean/luci-app-kms/luasrc/model/cbi/vlmcsd.lua
Normal file
65
package/lean/luci-app-kms/luasrc/model/cbi/vlmcsd.lua
Normal file
@ -0,0 +1,65 @@
|
||||
local m, s
|
||||
|
||||
local running=(luci.sys.call("pidof vlmcsd > /dev/null") == 0)
|
||||
if running then
|
||||
m = Map("vlmcsd", translate("vlmcsd config"), translate("<b><font color=green>Vlmcsd is running.</font></b>"))
|
||||
else
|
||||
m = Map("vlmcsd", translate("vlmcsd config"), translate("<b><font color=red>Vlmcsd is not running.</font></b>"))
|
||||
end
|
||||
|
||||
|
||||
s = m:section(TypedSection, "vlmcsd", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
s:tab("basic", translate("Basic Setting"))
|
||||
enable = s:taboption("basic",Flag, "enabled", translate("Enable"))
|
||||
enable.rmempty = false
|
||||
function enable.cfgvalue(self, section)
|
||||
return luci.sys.init.enabled("vlmcsd") and self.enabled or self.disabled
|
||||
end
|
||||
|
||||
local hostname = luci.model.uci.cursor():get_first("system", "system", "hostname")
|
||||
|
||||
autoactivate = s:taboption("basic", Flag, "autoactivate", translate("Auto activate"))
|
||||
autoactivate.rmempty = false
|
||||
|
||||
s:tab("config", translate("Config File"))
|
||||
config = s:taboption("config", Value, "config", translate("configfile"), translate("This file is /etc/vlmcsd.ini."), "")
|
||||
config.template = "cbi/tvalue"
|
||||
config.rows = 13
|
||||
config.wrap = "off"
|
||||
|
||||
function config.cfgvalue(self, section)
|
||||
return nixio.fs.readfile("/etc/vlmcsd.ini")
|
||||
end
|
||||
|
||||
function config.write(self, section, value)
|
||||
value = value:gsub("\r\n?", "\n")
|
||||
nixio.fs.writefile("/etc/vlmcsd.ini", value)
|
||||
end
|
||||
|
||||
function enable.write(self, section, value)
|
||||
if value == "1" then
|
||||
luci.sys.call("/etc/init.d/vlmcsd enable >/dev/null")
|
||||
luci.sys.call("/etc/init.d/vlmcsd start >/dev/null")
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart >/dev/null")
|
||||
else
|
||||
luci.sys.call("/etc/init.d/vlmcsd stop >/dev/null")
|
||||
luci.sys.call("/etc/init.d/vlmcsd disable >/dev/null")
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart >/dev/null")
|
||||
end
|
||||
Flag.write(self, section, value)
|
||||
end
|
||||
|
||||
function autoactivate.write(self, section, value)
|
||||
if value == "1" then
|
||||
luci.sys.call("sed -i '/srv-host=_vlmcs._tcp.lan/d' /etc/dnsmasq.conf")
|
||||
luci.sys.call("echo srv-host=_vlmcs._tcp.lan,".. hostname ..".lan,1688,0,100 >> /etc/dnsmasq.conf")
|
||||
else
|
||||
luci.sys.call("sed -i '/srv-host=_vlmcs._tcp.lan/d' /etc/dnsmasq.conf")
|
||||
end
|
||||
Flag.write(self, section, value)
|
||||
end
|
||||
|
||||
return m
|
38
package/lean/luci-app-kms/po/zh-cn/vlmcsd.zh-cn.po
Normal file
38
package/lean/luci-app-kms/po/zh-cn/vlmcsd.zh-cn.po
Normal file
@ -0,0 +1,38 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
msgid "vlmcsd config"
|
||||
msgstr "KMS服务器设置"
|
||||
|
||||
msgid "KMS Server"
|
||||
msgstr "KMS服务器"
|
||||
|
||||
msgid "Basic Setting"
|
||||
msgstr "基本设置"
|
||||
|
||||
msgid "Config File"
|
||||
msgstr "配置文件"
|
||||
|
||||
|
||||
msgid "<b><font color=green>Vlmcsd is running.</font></b>"
|
||||
msgstr "<b><font color=green>KMS 服务器运行中</font></b>"
|
||||
|
||||
msgid "<b><font color=red>Vlmcsd is not running.</font></b>"
|
||||
msgstr "<b><font color=red>KMS 服务器未运行</font></b>"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Auto activate"
|
||||
msgstr "自动激活局域网客户端"
|
||||
|
||||
msgid "configfile"
|
||||
msgstr "配置文件"
|
||||
|
||||
msgid "This file is /etc/vlmcsd.ini."
|
||||
msgstr "这个文件在 /etc/vlmcsd.ini 下,可以增加新的产品主密钥。"
|
4
package/lean/luci-app-kms/root/etc/config/vlmcsd
Normal file
4
package/lean/luci-app-kms/root/etc/config/vlmcsd
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
config vlmcsd 'config'
|
||||
option enabled '1'
|
||||
option autoactivate '1'
|
11
package/lean/luci-app-kms/root/etc/uci-defaults/luci-app-vlmcsd
Executable file
11
package/lean/luci-app-kms/root/etc/uci-defaults/luci-app-vlmcsd
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@vlmcsd[-1]
|
||||
add ucitrack vlmcsd
|
||||
set ucitrack.@vlmcsd[-1].init=vlmcsd
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
@ -1 +0,0 @@
|
||||
Subproject commit 192bd9a482dd15656613a56f64f5e8b49bf1bfb8
|
@ -1 +0,0 @@
|
||||
Subproject commit 6993a4a1ca6e6fd07700cf70a0580b4fcf1eb2c0
|
@ -1 +0,0 @@
|
||||
Subproject commit 68ad9fba57c70aba1d329c5b84e908557323ed5d
|
231
package/lean/shadowsocksR-libev-full/Makefile
Normal file
231
package/lean/shadowsocksR-libev-full/Makefile
Normal file
@ -0,0 +1,231 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=shadowsocksR-libev
|
||||
PKG_VERSION:=2.5.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/shadowsocksrr/shadowsocksr-libev.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9a2365ce6774dddd5561322881aef726c7990639
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_MAINTAINER:=breakwa11
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/shadowsocksr-libev/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Lightweight Secured Socks5 Proxy
|
||||
URL:=https://github.com/breakwa11/shadowsocks-libev
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev
|
||||
$(call Package/shadowsocksr-libev/Default)
|
||||
TITLE+= (OpenSSL)
|
||||
VARIANT:=openssl
|
||||
DEPENDS:=+libopenssl +libpthread +libpcre
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-alt
|
||||
$(call Package/shadowsocksr-libev/Default)
|
||||
TITLE+= (OpenSSL)
|
||||
VARIANT:=openssl
|
||||
DEPENDS:=+libopenssl +libpthread +libpcre +zlib
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-mini
|
||||
$(call Package/shadowsocksr-libev/Default)
|
||||
TITLE+= (PolarSSL)
|
||||
VARIANT:=polarssl
|
||||
DEPENDS:=+libpolarssl +libpthread +libpcre
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-polarssl
|
||||
$(call Package/shadowsocksr-libev/Default)
|
||||
TITLE+= (PolarSSL)
|
||||
VARIANT:=polarssl
|
||||
DEPENDS:=+libpolarssl +libpthread +libpcre
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-gfwlist
|
||||
$(call Package/shadowsocksr-libev/Default)
|
||||
TITLE+= (OpenSSL)
|
||||
VARIANT:=openssl
|
||||
DEPENDS:=+libopenssl +libpthread +dnsmasq-full +ipset +iptables +wget +libpcre
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-gfwlist-polarssl
|
||||
$(call Package/shadowsocksr-libev/Default)
|
||||
TITLE+= (PolarSSL)
|
||||
VARIANT:=polarssl
|
||||
DEPENDS:=+libpolarssl +libpthread +dnsmasq-full +ipset +iptables +wget-nossl +libpcre
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-gfwlist-4M
|
||||
$(call Package/shadowsocksr-libev/Default)
|
||||
TITLE+= (PolarSSL)
|
||||
VARIANT:=polarssl
|
||||
DEPENDS:=+libpolarssl +libpthread +dnsmasq-full +ipset +iptables +libpcre
|
||||
endef
|
||||
|
||||
|
||||
define Package/shadowsocksr-libev/description
|
||||
ShadowsocksR-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
|
||||
endef
|
||||
|
||||
Package/shadowsocksr-libev-mini/description=$(Package/shadowsocksr-libev/description)
|
||||
Package/shadowsocksr-libev-alt/description=$(Package/shadowsocksr-libev/description)
|
||||
Package/shadowsocksr-libev-polarssl/description=$(Package/shadowsocksr-libev/description)
|
||||
Package/shadowsocksr-libev-gfwlist/description=$(Package/shadowsocksr-libev/description)
|
||||
Package/shadowsocksr-libev-gfwlist-polarssl/description=$(Package/shadowsocksr-libev/description)
|
||||
Package/shadowsocksr-libev-gfwlist-4M/description=$(Package/shadowsocksr-libev/description)
|
||||
|
||||
|
||||
define Package/shadowsocksr-libev/conffiles
|
||||
/etc/shadowsocksr.json
|
||||
endef
|
||||
|
||||
Package/shadowsocksr-libev-alt/conffiles = $(Package/shadowsocksr-libev/conffiles)
|
||||
Package/shadowsocksr-libev-mini/conffiles = $(Package/shadowsocksr-libev/conffiles)
|
||||
Package/shadowsocksr-libev-polarssl/conffiles = $(Package/shadowsocksr-libev/conffiles)
|
||||
|
||||
define Package/shadowsocksr-libev-gfwlist/conffiles
|
||||
/etc/shadowsocksr.json
|
||||
/etc/dnsmasq.d/custom_list.conf
|
||||
endef
|
||||
|
||||
Package/shadowsocksr-libev-gfwlist-polarssl/conffiles = $(Package/shadowsocksr-libev-gfwlist/conffiles)
|
||||
Package/shadowsocksr-libev-gfwlist-4M/conffiles = $(Package/shadowsocksr-libev-gfwlist/conffiles)
|
||||
|
||||
|
||||
|
||||
Package/shadowsocksr-libev-server-polarssl/conffiles = $(Package/shadowsocksr-libev-server/conffiles)
|
||||
|
||||
define Package/shadowsocksr-libev-gfwlist/postinst
|
||||
#!/bin/sh
|
||||
if [ ! -f /etc/dnsmasq.d/custom_list.conf ]; then
|
||||
echo "ipset -N gfwlist iphash" >> /etc/firewall.user
|
||||
echo "iptables -t nat -A PREROUTING -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1080" >> /etc/firewall.user
|
||||
echo "iptables -t nat -A OUTPUT -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1080" >> /etc/firewall.user
|
||||
|
||||
echo "cache-size=5000" >> /etc/dnsmasq.conf
|
||||
echo "min-cache-ttl=1800" >> /etc/dnsmasq.conf
|
||||
echo "conf-dir=/etc/dnsmasq.d" >> /etc/dnsmasq.conf
|
||||
|
||||
echo "*/10 * * * * /root/ssr-watchdog >> /var/log/shadowsocksr_watchdog.log 2>&1" >> /etc/crontabs/root
|
||||
echo "0 1 * * 0 echo \"\" > /var/log/shadowsocksr_watchdog.log" >> /etc/crontabs/root
|
||||
fi
|
||||
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
ipset create gfwlist hash:ip
|
||||
iptables -t nat -I PREROUTING -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1080
|
||||
iptables -t nat -I OUTPUT -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1080
|
||||
|
||||
/etc/init.d/dnsmasq restart
|
||||
/etc/init.d/cron restart
|
||||
/etc/init.d/shadowsocksr restart
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/shadowsocks-libev-gfwlist/postrm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
sed -i '/cache-size=5000/d' /etc/dnsmasq.conf
|
||||
sed -i '/min-cache-ttl=1800/d' /etc/dnsmasq.conf
|
||||
sed -i '/conf-dir=\/etc\/dnsmasq.d/d' /etc/dnsmasq.conf
|
||||
rm -rf /etc/dnsmasq.d
|
||||
/etc/init.d/dnsmasq restart
|
||||
|
||||
sed -i '/ipset create gfwlist hash:ip/d' /etc/firewall.user
|
||||
sed -i '/iptables -t nat -I PREROUTING -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1080/d' /etc/firewall.user
|
||||
sed -i '/iptables -t nat -I OUTPUT -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1080/d' /etc/firewall.user
|
||||
ipset flush gfwlist
|
||||
|
||||
sed -i '/shadowsocksr_watchdog.log/d' /etc/crontabs/root
|
||||
/etc/init.d/cron restart
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
Package/shadowsocksr-libev-gfwlist-polarssl/postinst = $(Package/shadowsocksr-libev-gfwlist/postinst)
|
||||
Package/shadowsocksr-libev-gfwlist-polarssl/postrm = $(Package/shadowsocksr-libev-gfwlist/postrm)
|
||||
Package/shadowsocksr-libev-gfwlist-4M/postinst = $(Package/shadowsocksr-libev-gfwlist/postinst)
|
||||
Package/shadowsocksr-libev-gfwlist-4M/postrm = $(Package/shadowsocksr-libev-gfwlist/postrm)
|
||||
|
||||
CONFIGURE_ARGS += --disable-ssp
|
||||
|
||||
ifeq ($(BUILD_VARIANT),polarssl)
|
||||
CONFIGURE_ARGS += --with-crypto-library=polarssl
|
||||
endif
|
||||
|
||||
define Package/shadowsocksr-libev/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/shadowsocksr $(1)/etc/init.d/shadowsocksr
|
||||
$(INSTALL_CONF) ./files/shadowsocksr.json $(1)/etc/shadowsocksr.json
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-local $(1)/usr/bin/ssr-local
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-redir $(1)/usr/bin/ssr-redir
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-tunnel $(1)/usr/bin/ssr-tunnel
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-mini/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-redir $(1)/usr/bin/ssr-redir
|
||||
endef
|
||||
|
||||
define Package/shadowsocksr-libev-alt/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-redir $(1)/usr/bin/ssr-redir
|
||||
endef
|
||||
|
||||
Package/shadowsocksr-libev-polarssl/install=$(Package/shadowsocksr-libev/install)
|
||||
|
||||
define Package/shadowsocksr-libev-gfwlist/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-redir $(1)/usr/bin/ssr-redir
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-tunnel $(1)/usr/bin/ssr-tunnel
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/shadowsocksr-gfwlist $(1)/etc/init.d/shadowsocksr
|
||||
$(INSTALL_CONF) ./files/shadowsocksr-gfwlist.json $(1)/etc/shadowsocksr.json.main
|
||||
$(INSTALL_CONF) ./files/shadowsocksr-gfwlist.json $(1)/etc/shadowsocksr.json.backup
|
||||
$(INSTALL_CONF) ./files/firewall.user $(1)/etc/firewall.user
|
||||
$(INSTALL_CONF) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf
|
||||
$(INSTALL_DIR) $(1)/etc/dnsmasq.d
|
||||
$(INSTALL_CONF) ./files/gfw_list.conf $(1)/etc/dnsmasq.d/gfw_list.conf
|
||||
$(INSTALL_CONF) ./files/custom_list.conf $(1)/etc/dnsmasq.d/custom_list.conf
|
||||
$(INSTALL_DIR) $(1)/root
|
||||
$(INSTALL_BIN) ./files/ssr-watchdog $(1)/root/ssr-watchdog
|
||||
$(INSTALL_DIR) $(1)/etc/crontabs
|
||||
$(INSTALL_CONF) ./files/root $(1)/etc/crontabs/root
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller
|
||||
$(INSTALL_CONF) ./files/shadowsocksr-libev.lua $(1)/usr/lib/lua/luci/controller/shadowsocksr-libev.lua
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/shadowsocksr-libev
|
||||
$(INSTALL_CONF) ./files/shadowsocksr-libev-general.lua $(1)/usr/lib/lua/luci/model/cbi/shadowsocksr-libev/shadowsocksr-libev-general.lua
|
||||
$(INSTALL_CONF) ./files/shadowsocksr-libev-backup.lua $(1)/usr/lib/lua/luci/model/cbi/shadowsocksr-libev/shadowsocksr-libev-backup.lua
|
||||
$(INSTALL_CONF) ./files/shadowsocksr-libev-custom.lua $(1)/usr/lib/lua/luci/model/cbi/shadowsocksr-libev/shadowsocksr-libev-custom.lua
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/shadowsocksr-libev
|
||||
$(INSTALL_CONF) ./files/gfwlistr.htm $(1)/usr/lib/lua/luci/view/shadowsocksr-libev/gfwlistr.htm
|
||||
$(INSTALL_CONF) ./files/watchdogr.htm $(1)/usr/lib/lua/luci/view/shadowsocksr-libev/watchdogr.htm
|
||||
endef
|
||||
|
||||
Package/shadowsocksr-libev-gfwlist-polarssl/install = $(Package/shadowsocksr-libev-gfwlist/install)
|
||||
Package/shadowsocksr-libev-gfwlist-4M/install = $(Package/shadowsocksr-libev-gfwlist/install)
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev))
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev-mini))
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev-alt))
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev-polarssl))
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev-gfwlist))
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev-gfwlist-polarssl))
|
||||
$(eval $(call BuildPackage,shadowsocksr-libev-gfwlist-4M))
|
||||
|
@ -0,0 +1,2 @@
|
||||
#server=/.baidu.com/127.0.0.1#5353
|
||||
#ipset=/.baidu.com/gfwlist
|
41
package/lean/shadowsocksR-libev-full/files/dnsmasq.conf
Normal file
41
package/lean/shadowsocksR-libev-full/files/dnsmasq.conf
Normal file
@ -0,0 +1,41 @@
|
||||
# Change the following lines if you want dnsmasq to serve SRV
|
||||
# records.
|
||||
# You may add multiple srv-host lines.
|
||||
# The fields are <name>,<target>,<port>,<priority>,<weight>
|
||||
|
||||
# A SRV record sending LDAP for the example.com domain to
|
||||
# ldapserver.example.com port 289
|
||||
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389
|
||||
|
||||
# Two SRV records for LDAP, each with different priorities
|
||||
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,1
|
||||
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,2
|
||||
|
||||
# A SRV record indicating that there is no LDAP server for the domain
|
||||
# example.com
|
||||
#srv-host=_ldap._tcp.example.com
|
||||
|
||||
# The following line shows how to make dnsmasq serve an arbitrary PTR
|
||||
# record. This is useful for DNS-SD.
|
||||
# The fields are <name>,<target>
|
||||
#ptr-record=_http._tcp.dns-sd-services,"New Employee Page._http._tcp.dns-sd-services"
|
||||
|
||||
# Change the following lines to enable dnsmasq to serve TXT records.
|
||||
# These are used for things like SPF and zeroconf.
|
||||
# The fields are <name>,<text>,<text>...
|
||||
|
||||
#Example SPF.
|
||||
#txt-record=example.com,"v=spf1 a -all"
|
||||
|
||||
#Example zeroconf
|
||||
#txt-record=_http._tcp.example.com,name=value,paper=A4
|
||||
|
||||
# Provide an alias for a "local" DNS name. Note that this _only_ works
|
||||
# for targets which are names from DHCP or /etc/hosts. Give host
|
||||
# "bert" another name, bertrand
|
||||
# The fields are <cname>,<target>
|
||||
#cname=bertand,bert
|
||||
|
||||
cache-size=1000
|
||||
min-cache-ttl=1800
|
||||
conf-dir=/etc/dnsmasq.d
|
11
package/lean/shadowsocksR-libev-full/files/firewall.user
Normal file
11
package/lean/shadowsocksR-libev-full/files/firewall.user
Normal file
@ -0,0 +1,11 @@
|
||||
# This file is interpreted as shell script.
|
||||
# Put your custom iptables rules here, they will
|
||||
# be executed with each firewall (re-)start.
|
||||
|
||||
# Internal uci firewall chains are flushed and recreated on reload, so
|
||||
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
|
||||
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
|
||||
|
||||
ipset create gfwlist hash:ip
|
||||
iptables -t nat -I PREROUTING -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 8989
|
||||
iptables -t nat -I OUTPUT -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 8989
|
6988
package/lean/shadowsocksR-libev-full/files/gfw_list.conf
Normal file
6988
package/lean/shadowsocksR-libev-full/files/gfw_list.conf
Normal file
File diff suppressed because it is too large
Load Diff
7
package/lean/shadowsocksR-libev-full/files/gfwlistr.htm
Normal file
7
package/lean/shadowsocksR-libev-full/files/gfwlistr.htm
Normal file
@ -0,0 +1,7 @@
|
||||
<%+header%>
|
||||
<h2><a id="content" name="content"><%:ShadowsocksR - GFW List%></a></h2>
|
||||
<div class="cbi-map-descr">ShadowsocksR内置的 GFW 名单</div>
|
||||
<div id="content_gfwlist">
|
||||
<textarea readonly="readonly" wrap="off" style="width: 100%" rows="20" id="gfwlist"><%=gfwlist:pcdata()%></textarea>
|
||||
</div>
|
||||
<%+footer%>
|
3
package/lean/shadowsocksR-libev-full/files/root
Normal file
3
package/lean/shadowsocksR-libev-full/files/root
Normal file
@ -0,0 +1,3 @@
|
||||
*/10 * * * * /root/ssr-watchdog >> /var/log/shadowsocksr_watchdog.log 2>&1
|
||||
0 1 * * 0 echo "" > /var/log/shadowsocksr_watchdog.log
|
||||
#0 1 * * 0 sleep 70 && touch /etc/banner && reboot
|
21
package/lean/shadowsocksR-libev-full/files/shadowsocksr
Normal file
21
package/lean/shadowsocksR-libev-full/files/shadowsocksr
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=95
|
||||
|
||||
SERVICE_USE_PID=1
|
||||
SERVICE_WRITE_PID=1
|
||||
SERVICE_DAEMONIZE=1
|
||||
|
||||
CONFIG=/etc/shadowsocksr.json
|
||||
|
||||
start() {
|
||||
service_start /usr/bin/ssr-local -c $CONFIG -l 8888
|
||||
#service_start /usr/bin/ssr-redir -c $CONFIG
|
||||
#service_start /usr/bin/ssr-tunnel -c $CONFIG -l 5353 -L 8.8.8.8:53 -U
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/bin/ssr-local
|
||||
#service_stop /usr/bin/ssr-redir
|
||||
#service_stop /usr/bin/ssr-tunnel
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=95
|
||||
|
||||
SERVICE_USE_PID=1
|
||||
SERVICE_WRITE_PID=1
|
||||
SERVICE_DAEMONIZE=1
|
||||
|
||||
CONFIG=/etc/shadowsocksr.json
|
||||
if [ ! -f $CONFIG ]; then
|
||||
ln -sf /etc/shadowsocksr.json.main $CONFIG
|
||||
fi
|
||||
|
||||
start() {
|
||||
service_start /usr/bin/ssr-redir -c $CONFIG -b 0.0.0.0 -l 8989
|
||||
sleep 1
|
||||
service_start /usr/bin/ssr-tunnel -c $CONFIG -b 0.0.0.0 -l 5353 -L 8.8.8.8:53 -U
|
||||
sleep 1
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/bin/ssr-redir
|
||||
sleep 1
|
||||
service_stop /usr/bin/ssr-tunnel
|
||||
sleep 1
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"server": "serv-ro.ddns.info",
|
||||
"server_port": 23143,
|
||||
"password": "test.TEST",
|
||||
"method": "aes-256-cfb",
|
||||
"protocol": "origin",
|
||||
"obfs": "plain",
|
||||
"timeout": 120,
|
||||
"supported_protocol": "origin, verify_simple, auth_simple, auth_sha1, auth_sha1_v2, auth_sha1_v4",
|
||||
"supported_obfs": "plain, http_simple, tls1.0_session_auth, tls1.2_ticket_auth"
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
local fs = require "nixio.fs"
|
||||
local conffile = "/etc/shadowsocksr.json.backup"
|
||||
|
||||
f = SimpleForm("general", translate("ShadowsocksR - 备份服务器设置"), translate("ShadowsocksR 备份服务器设置地址,当主服务器不可时将自动连接到此服务器。 主服务器可用时将自动切换回主服务器"))
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 20
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/shadowsocksr restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
@ -0,0 +1,23 @@
|
||||
local fs = require "nixio.fs"
|
||||
local conffile = "/etc/dnsmasq.d/custom_list.conf"
|
||||
|
||||
f = SimpleForm("custom", translate("ShadowsocksR - 自定义列表"), translate("ShadowsocksR 自动定义翻墙域名的列表。<BR />请参照以下写法去掉前面的 # 输入"))
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 20
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart && ipset flush gfwlist")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
@ -0,0 +1,23 @@
|
||||
local fs = require "nixio.fs"
|
||||
local conffile = "/etc/shadowsocksr.json.main"
|
||||
|
||||
f = SimpleForm("general", translate("ShadowsocksR - 主服务器配置"), translate("ShadowsocksR 主服务器配置文件,此服务器将优先被使用"))
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 20
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/shadowsocksr restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
@ -0,0 +1,45 @@
|
||||
module("luci.controller.shadowsocksr-libev", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/shadowsocksr.json") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "services", "shadowsocksr-libev"},
|
||||
alias("admin", "services", "shadowsocksr-libev", "general"),
|
||||
_("ShadowsocksR设置"), 10)
|
||||
|
||||
entry({"admin", "services", "shadowsocksr-libev", "general"},
|
||||
cbi("shadowsocksr-libev/shadowsocksr-libev-general"),
|
||||
_("主服务器设置"), 10).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr-libev", "backup"},
|
||||
cbi("shadowsocksr-libev/shadowsocksr-libev-backup"),
|
||||
_("备份服务器设置"), 20).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr-libev", "gfwlist"},
|
||||
call("action_gfwlist"),
|
||||
_("GFW 内置名单"), 30).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr-libev", "custom"},
|
||||
cbi("shadowsocksr-libev/shadowsocksr-libev-custom"),
|
||||
_("自定义域名列表"), 40).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr-libev", "watchdog"},
|
||||
call("action_watchdog"),
|
||||
_("守护进程日志"), 50).leaf = true
|
||||
end
|
||||
|
||||
function action_gfwlist()
|
||||
local fs = require "nixio.fs"
|
||||
local conffile = "/etc/dnsmasq.d/gfw_list.conf"
|
||||
local gfwlist = fs.readfile(conffile) or ""
|
||||
luci.template.render("shadowsocksr-libev/gfwlistr", {gfwlist=gfwlist})
|
||||
end
|
||||
|
||||
function action_watchdog()
|
||||
local fs = require "nixio.fs"
|
||||
local conffile = "/var/log/shadowsocksr_watchdog.log"
|
||||
local watchdog = fs.readfile(conffile) or ""
|
||||
luci.template.render("shadowsocksr-libev/watchdogr", {watchdog=watchdog})
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=95
|
||||
|
||||
SERVICE_USE_PID=1
|
||||
SERVICE_WRITE_PID=1
|
||||
SERVICE_DAEMONIZE=1
|
||||
|
||||
CONFIG=/etc/shadowsocksr-server.json
|
||||
|
||||
start() {
|
||||
service_start /usr/bin/ssr-server -c $CONFIG -u
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/bin/ssr-server
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
{
|
||||
"server": "0.0.0.0",
|
||||
"server_ipv6": "::",
|
||||
"server_port": 443,
|
||||
"password": "password",
|
||||
"method": "rc4-md5",
|
||||
"timeout": 120,
|
||||
"protocol": "origin",
|
||||
"protocol_param": "",
|
||||
"obfs": "plain",
|
||||
"obfs_param": "",
|
||||
"redirect": "",
|
||||
"dns_ipv6": false,
|
||||
"fast_open": false
|
||||
}
|
14
package/lean/shadowsocksR-libev-full/files/shadowsocksr.json
Normal file
14
package/lean/shadowsocksR-libev-full/files/shadowsocksr.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"server": "serverip",
|
||||
"server_port": 443,
|
||||
"password": "password",
|
||||
"method": "rc4-md5",
|
||||
"local_address": "0.0.0.0",
|
||||
"local_port": 1080,
|
||||
"timeout": 120,
|
||||
"protocol": "origin",
|
||||
"protocol_param": "",
|
||||
"obfs": "plain",
|
||||
"obfs_param": "",
|
||||
"fast_open": false
|
||||
}
|
47
package/lean/shadowsocksR-libev-full/files/ssr-watchdog
Normal file
47
package/lean/shadowsocksR-libev-full/files/ssr-watchdog
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
|
||||
CURRENT=$(ls -l /etc/shadowsocksr.json | awk -F "." '{print $4}')
|
||||
|
||||
if [ "$CURRENT" == "backup" ]; then
|
||||
echo "[$LOGTIME] Backup server is running."
|
||||
MAIN=$(cat /etc/shadowsocksr.json.main | awk -F '\"' '/\"server\"/ {print $4}')
|
||||
PM=$(ping -c 3 $MAIN | grep 'loss' | awk -F ',' '{ print $3 }' | awk -F "%" '{ print $1 }')
|
||||
if [ "$PM" -lt "50" ]; then
|
||||
echo "[$LOGTIME] Main server up,$PM% packet loss, switch back."
|
||||
ln -sf /etc/shadowsocksr.json.main /etc/shadowsocksr.json
|
||||
CURRENT=$(ls -l /etc/shadowsocksr.json | awk -F "." '{print $4}')
|
||||
/etc/init.d/shadowsocksr restart
|
||||
sleep 3
|
||||
else
|
||||
echo "[$LOGTIME] Main server down,$PM% packet loss."
|
||||
fi
|
||||
fi
|
||||
|
||||
wget --spider --quiet -T 3 www.google.com.hk
|
||||
if [ "$?" == "0" ]; then
|
||||
echo "[$LOGTIME] No problem."
|
||||
exit 0
|
||||
else
|
||||
wget --spider --quiet -T 3 www.baidu.com
|
||||
if [ "$?" == "0" ]; then
|
||||
echo "[$LOGTIME] Problem decteted, restart ShadowsocksR."
|
||||
/etc/init.d/shadowsocksr restart
|
||||
if [ "$CURRENT" == "main" ]; then
|
||||
sleep 3
|
||||
wget --spider --quiet -T 3 www.google.com.hk
|
||||
if [ "$?" == "0" ]; then
|
||||
echo "[$LOGTIME] ShadowsocksR recovered."
|
||||
exit 0
|
||||
else
|
||||
echo "[$LOGTIME] Main server down, switch to backup server."
|
||||
ln -sf /etc/shadowsocksr.json.backup /etc/shadowsocksr.json
|
||||
/etc/init.d/shadowsocksr restart
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "[$LOGTIME] Network problem. Do nothing."
|
||||
fi
|
||||
fi
|
7
package/lean/shadowsocksR-libev-full/files/watchdogr.htm
Normal file
7
package/lean/shadowsocksR-libev-full/files/watchdogr.htm
Normal file
@ -0,0 +1,7 @@
|
||||
<%+header%>
|
||||
<h2><a id="content" name="content"><%:ShadowsocksR - 守护进程日志%></a></h2>
|
||||
<div class="cbi-map-descr">ShadowsocksR 守护进程日志</div>
|
||||
<div id="content_watchdog">
|
||||
<textarea readonly="readonly" wrap="off" style="width: 100%" rows="20" id="watchdog"><%=watchdog:pcdata()%></textarea>
|
||||
</div>
|
||||
<%+footer%>
|
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 000.png
Normal file
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 000.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 001.png
Normal file
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 001.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 002.png
Normal file
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 002.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 003.png
Normal file
BIN
package/lean/shadowsocksR-libev-full/snapshot/luci 003.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
47
package/lean/vlmcsd/Makefile
Normal file
47
package/lean/vlmcsd/Makefile
Normal file
@ -0,0 +1,47 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=vlmcsd
|
||||
PKG_VERSION=svn1107
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=fuyumi <280604399@qq.com>
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/mchome/vlmcsd.git
|
||||
PKG_SOURCE_VERSION:=176a19ecb630598008d679bbc62170778a1d6516
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/vlmcsd
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=vlmcsd for OpenWRT
|
||||
URL:=http://forums.mydigitallife.info/threads/50234
|
||||
DEPENDS:=+libpthread
|
||||
endef
|
||||
|
||||
define Package/vlmcsd/description
|
||||
vlmcsd is a KMS Emulator in C.
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
-C $(PKG_BUILD_DIR)
|
||||
|
||||
define Package/vlmcsd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/vlmcsd $(1)/usr/bin/vlmcsd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/vlmcs $(1)/usr/bin/vlmcs
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_BIN) ./files/vlmcsd.ini $(1)/etc/vlmcsd.ini
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/vlmcsd.init $(1)/etc/init.d/vlmcsd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,vlmcsd))
|
59
package/lean/vlmcsd/files/vlmcsd.ini
Normal file
59
package/lean/vlmcsd/files/vlmcsd.ini
Normal file
@ -0,0 +1,59 @@
|
||||
#ePID/HwId设置为Windows显式
|
||||
;55c92734-d682-4d71-983e-d6ec3f16059f = 06401-00206-271-392041-03-1033-9600.0000-3622014 / 01 02 03 04 05 06 07 08
|
||||
|
||||
#ePID设置为Office2010(包含Visio和Project)显式
|
||||
;59a52881-a989-479d-af46-f275c6370663 = 06401-00096-199-496023-03-1033-9600.0000-3622014
|
||||
|
||||
#ePID设置为Office2013(包含Visio和Project)显式
|
||||
;0ff1ce15-a989-479d-af46-f275c6370663 = 06401-00206-234-409313-03-1033-9600.0000-3622014
|
||||
|
||||
#使用自定义TCP端口
|
||||
;Port = 1688
|
||||
|
||||
#监听所有IPv4地址(默认端口1688)
|
||||
;Listen = 0.0.0.0:1688
|
||||
|
||||
#监听所有IPv6地址(默认端口1688)
|
||||
;Listen = [::]:1688
|
||||
|
||||
#程序启动时随机ePIDs(只有那些未显式指定的)
|
||||
;RandomizationLevel = 1
|
||||
|
||||
#在ePIDs中使用特定区域 (1033 = 美国英语),即使ePID是随机的
|
||||
;LCID = 1033
|
||||
|
||||
#设置最多4个同时工作(分叉进程或线程)
|
||||
;MaxWorkers = 4
|
||||
|
||||
#闲置30秒后断开用户
|
||||
;ConnectionTimeout = 30
|
||||
|
||||
#每次请求后立即断开客户端
|
||||
;DisconnectClientsImmediately = yes
|
||||
|
||||
#写一个pid文件(包含vlmcsd的进程ID的文件)
|
||||
;PidFile = /var/run/vlmcsd.pid
|
||||
|
||||
#写日志到/var/log/vlmcsd.log
|
||||
;LogFile = /var/log/vlmcsd.log
|
||||
|
||||
#创建详细日志
|
||||
;LogVerbose = true
|
||||
|
||||
#设置激活间隔2小时
|
||||
;ActivationInterval = 2h
|
||||
|
||||
#设置更新间隔7天
|
||||
;RenewalInterval = 7d
|
||||
|
||||
#运行程序的用户为vlmcsduser
|
||||
;user = vlmcsduser
|
||||
|
||||
#运行程序的组为vlmcsdgroup
|
||||
;group = vlmcsdgroup
|
||||
|
||||
#禁用或启用RPC的NDR64传输语法(默认启用)
|
||||
;UseNDR64 = true
|
||||
|
||||
#禁用或启用RPC的绑定时间特性协商(默认启用)
|
||||
;UseBTFN = true
|
37
package/lean/vlmcsd/files/vlmcsd.init
Normal file
37
package/lean/vlmcsd/files/vlmcsd.init
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (c) 2011-2015 OpenWrt.org
|
||||
|
||||
START=90
|
||||
|
||||
start(){
|
||||
if [ ! -f "/tmp/vlmcsd.pid" ]; then
|
||||
/usr/bin/vlmcsd -i /etc/vlmcsd.ini -p /tmp/vlmcsd.pid -L 0.0.0.0:1688
|
||||
iptables -D input_rule -p tcp --dport 1688 -j ACCEPT
|
||||
iptables -A input_rule -p tcp --dport 1688 -j ACCEPT
|
||||
sed -i '/## luci-app-vlmcsd/d' /etc/firewall.user
|
||||
echo "iptables -A input_rule -p tcp --dport 1688 -j ACCEPT ## luci-app-vlmcsd" >> /etc/firewall.user
|
||||
echo "KMS Server has started."
|
||||
else
|
||||
echo "KMS Server has already started."
|
||||
fi
|
||||
}
|
||||
|
||||
stop(){
|
||||
if [ ! -f "/tmp/vlmcsd.pid" ]; then
|
||||
echo "KMS Server is not running."
|
||||
else
|
||||
pid=`cat /tmp/vlmcsd.pid`
|
||||
kill $pid
|
||||
rm -f /tmp/vlmcsd.pid
|
||||
iptables -D input_rule -p tcp --dport 1688 -j ACCEPT
|
||||
sed -i '/## luci-app-vlmcsd/d' /etc/firewall.user
|
||||
echo "KMS Server has stopped."
|
||||
fi
|
||||
}
|
||||
|
||||
restart(){
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
echo "KMS Server has restarted."
|
||||
}
|
Loading…
Reference in New Issue
Block a user