xray-core: add init script

Add init script so the users could run it with their configs quickly.

Signed-off-by: Tianling Shen <cnsztl@project-openwrt.eu.org>
This commit is contained in:
Tianling Shen
2021-02-04 01:12:08 +08:00
parent c8c2564012
commit 6c9b96352f
5 changed files with 231 additions and 1 deletions
+16 -1
View File
@@ -75,6 +75,11 @@ define Package/xray-geodata/description
This includes GEO datas used for xray-core.
endef
define Package/xray-core/conffiles
/etc/xray/
/etc/config/xray
endef
GEOIP_VER:=202101280019
GEOIP_FILE:=geoip.dat.$(GEOIP_VER)
@@ -105,10 +110,20 @@ endef
define Package/xray-core/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/xray
$(LN) xray $(1)/usr/bin/v2ray
$(INSTALL_DIR) $(1)/etc/xray/
$(INSTALL_CONF) $(CURDIR)/files/config.json.example $(1)/etc/xray/
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_CONF) $(CURDIR)/files/xray.conf $(1)/etc/config/xray
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(CURDIR)/files/xray.init $(1)/etc/init.d/xray
$(INSTALL_DIR) $(1)/etc/capabilities/
$(INSTALL_DATA) $(CURDIR)/files/xray.capabilities $(1)/etc/capabilities/xray.json
endef
define Package/xray-example/install