aboutsummaryrefslogtreecommitdiff
path: root/net/xray-core/Makefile
diff options
context:
space:
mode:
authorTianling Shen <cnsztl@project-openwrt.eu.org>2021-02-04 01:12:08 +0800
committerTianling Shen <cnsztl@project-openwrt.eu.org>2021-02-04 06:29:58 +0800
commit6c9b96352fb5e7d6acdf8f14ea4f9251cd09926b (patch)
treea97051163370492dc6a27ea8c308c6e75266fdc5 /net/xray-core/Makefile
parentc8c2564012aae4f19434b69cbdeb868f9d84a9d8 (diff)
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>
Diffstat (limited to 'net/xray-core/Makefile')
-rw-r--r--net/xray-core/Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/net/xray-core/Makefile b/net/xray-core/Makefile
index f886985f4..42eb5a48e 100644
--- a/net/xray-core/Makefile
+++ b/net/xray-core/Makefile
@@ -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