diff --git a/pdnsd-alt/Makefile b/pdnsd-alt/Makefile index e2c1aac..37edb88 100644 --- a/pdnsd-alt/Makefile +++ b/pdnsd-alt/Makefile @@ -47,11 +47,6 @@ define Package/pdnsd-alt/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pdnsd $(1)/usr/sbin/pdnsd $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/pdnsd-ctl $(1)/usr/sbin/pdnsd-ctl - - #$(INSTALL_DIR) $(1)/etc - #$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/pdnsd.conf.sample $(1)/etc/pdnsd.conf - #$(INSTALL_DIR) $(1)/etc/init.d - #$(INSTALL_BIN) ./files/pdnsd.init $(1)/etc/init.d/pdnsd endef $(eval $(call BuildPackage,pdnsd-alt)) diff --git a/pdnsd-alt/files/pdnsd.init b/pdnsd-alt/files/pdnsd.init deleted file mode 100755 index e678d8d..0000000 --- a/pdnsd-alt/files/pdnsd.init +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=65 -NAME=pdnsd -DESC="proxy DNS server" - -DAEMON=/usr/sbin/pdnsd -PID_FILE=/var/run/$NAME.pid -CACHEDIR=/var/pdnsd -CACHE=$CACHEDIR/pdnsd.cache - -USER=nobody -GROUP=nogroup - -start() { - echo -n "Starting $DESC: $NAME" - - gen_cache - - $DAEMON --daemon -p $PID_FILE - echo " ." -} - -stop() { - echo -n "Stopping $DESC: $NAME" - kill `cat $PID_FILE` > /dev/null 2>&1 - rm -rf $PID_FILE - echo " ." -} - -restart() { - echo "Restarting $DESC: $NAME... " - stop - sleep 2 - start -} - -gen_cache() -{ - if ! test -f "$CACHE"; then - mkdir -p `dirname $CACHE` - dd if=/dev/zero of="$CACHE" bs=1 count=4 2> /dev/null - chown -R $USER.$GROUP $CACHEDIR - fi -} - diff --git a/sing-box/Makefile b/sing-box/Makefile index 1eba502..685930c 100644 --- a/sing-box/Makefile +++ b/sing-box/Makefile @@ -133,17 +133,10 @@ GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \ )) define Package/$(PKG_NAME)/conffiles -/etc/sing-box/config.json endef define Package/$(PKG_NAME)/install $(call GoPackage/Package/Install/Bin,$(1)) - - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/sing-box.init $(1)/etc/init.d/sing-box - - $(INSTALL_DIR) $(1)/etc/sing-box - $(INSTALL_DATA) ./files/config.json.example $(1)/etc/sing-box/config.json.example endef $(eval $(call GoBinPackage,sing-box)) diff --git a/sing-box/files/config.json.example b/sing-box/files/config.json.example deleted file mode 100644 index eb55156..0000000 --- a/sing-box/files/config.json.example +++ /dev/null @@ -1,296 +0,0 @@ -{ - "log": { - "disabled": false, - "level": "warn", - "output": "/tmp/sing-box.log", - "timestamp": true - }, - "experimental": { - "clash_api": { - "external_controller": "0.0.0.0:9090", - "external_ui": "", - "secret": "********", - "default_mode": "rule", - "store_selected": true, - "cache_file": "cache.db" - } - }, - "dns": { - "servers": [ - { - "tag": "foreign", - "address": "https://1.1.1.1/dns-query" - }, - { - "tag": "local", - "address": "tls://1.12.12.12", - "detour": "direct" - }, - { - "tag": "block", - "address": "rcode://success" - } - ], - "rules": [ - { - "geosite": "category-ads-all", - "server": "block", - "disable_cache": true - }, - { - "domain": "mydomain.com", - "geosite": "cn", - "server": "local" - } - ], - "strategy": "ipv4_only" - }, - "ntp": { - "enabled": false, - "server": "ntp.aliyun.com", - "server_port": 123, - "interval": "30m", - "detour": "direct" - }, - "inbounds": [ - { - "type": "tun", - "tag": "TUN-in", - "interface_name": "sb-tun0", - "inet4_address": "172.19.0.1/30", - "auto_route": false, - "endpoint_independent_nat": true, - "stack": "system", - "sniff": true - }, - { - "type": "mixed", - "tag": "SOCKS-in", - "listen": "::", - "listen_port": ***** - }, - { - "type": "redirect", - "tag": "REDIRECT-in", - "listen": "::", - "listen_port": *****, - "sniff": true - }, - { - "type": "tproxy", - "tag": "TPROXY-in", - "listen": "::", - "listen_port": *****, - "sniff": true - }, - { - "type": "direct", - "tag": "DNS-in", - "listen": "::", - "listen_port": *****, - "network": "udp", - "sniff": true - }, - { - "type": "shadowsocks", - "tag": "SS-in", - "listen": "::", - "listen_port": *****, - "sniff": true, - "method": "2022-blake3-aes-128-gcm", - "password": "bZzjl2DAXUs02L2Sosgu7A==", - "users": [ - { - "name": "User1", - "password": "SGEFjWc+VgNGBXe1JhoRfg==" - }, - { - "name": "User2", - "password": "XoXhbj4V9cMXfuUXF/C+cg==" - } - ] - } - ], - "outbounds": [ - { - "type": "selector", - "tag": "Proxy-out", - "outbounds": [ - "URL-Test", - "direct", - "Shadowsocks-ShadowTLS-out", - "Trojan-GRPC-out", - "Trojan-WebSocket-out", - "Hysteria-out" - ], - "default": "URL-Test" - }, - { - "type": "urltest", - "tag": "URL-Test", - "outbounds": [ - "Shadowsocks-ShadowTLS-out", - "Trojan-GRPC-out", - "Trojan-WebSocket-out", - "Hysteria-out" - ], - "url": "https://cp.cloudflare.com", - "interval": "1m", - "tolerance": 50 - }, - { - "type": "shadowsocks", - "tag": "Shadowsocks-ShadowTLS-out", - "detour": "Shadowsocks-ShadowTLS", - "method": "2022-blake3-aes-128-gcm", - "password": "F7cx1ASHX/eqQwed+pISzw==:CB8sXcYLzf1P5dUizIzYVg==", - "udp_over_tcp": true, - "multiplex": { - "enabled": false, - "max_connections": 4, - "min_streams": 4, - "max_streams": 0 - } - }, - { - "type": "shadowtls", - "tag": "Shadowsocks-ShadowTLS", - "server": "***.***.***.***", - "server_port": *****, - "version": 3, - "password": "************", - "tls": { - "enabled": true, - "server_name": "something.example.org", - "utls": { - "enabled": true, - "fingerprint": "chrome" - } - } - }, - { - "type": "trojan", - "tag": "Trojan-GRPC-out", - "server": "***.***.***.***", - "server_port": *****, - "password": "************", - "transport": { - "type": "grpc", - "service_name": "************" - }, - "tls": { - "enabled": true, - "disable_sni": false, - "server_name": "yours.example.org", - "utls": { - "enabled": true, - "fingerprint": "chrome" - } - } - }, - { - "type": "trojan", - "tag": "WebSocket-out", - "server": "***.***.***.***", - "server_port": *****, - "password": "************", - "transport": { - "type": "ws", - "path": "/************", - "early_data_header_name": "Sec-WebSocket-Protocol" - }, - "tls": { - "enabled": true, - "disable_sni": false, - "server_name": "yours.example.org", - "utls": { - "enabled": true, - "fingerprint": "chrome" - } - }, - "multiplex": { - "enabled": true, - "max_connections": 4, - "min_streams": 4, - "max_streams": 0 - } - }, - { - "type": "hysteria", - "tag": "Hysteria-out", - "server": "***.***.***.***", - "server_port": *****, - "up_mbps": 100, - "down_mbps": , - "obfs": "************", - "auth_str": "************", - "tls": { - "enabled": true, - "disable_sni": false, - "server_name": "yours.example.org", - "alpn": [ - "h3" - ] - } - }, - { - "type": "direct", - "tag": "direct" - }, - { - "type": "block", - "tag": "block" - }, - { - "type": "dns", - "tag": "dns-out" - } - ], - "route": { - "geoip": { - "path": "/tmp/geoip.db", - "download_url": "https://github.com/1715173329/sing-geoip/releases/latest/download/geoip.db", - "download_detour": "" - }, - "geosite": { - "path": "/tmp/geosite.db", - "download_url": "https://github.com/1715173329/sing-geosite/releases/latest/download/geosite.db", - "download_detour": "" - }, - "rules": [ - { - "protocol": "dns", - "outbound": "dns-out" - }, - { - "protocol": "quic", - "outbound": "block" - }, - { - "geosite": "category-ads-all", - "outbound": "block" - }, - { - "geoip": [ - "telegram" - ], - "outbound": "Trojan-GRPC-out" - }, - { - "inbound": [ - "SOCKS-in" - ], - "outbound": "Proxy-out" - }, - { - "geosite": "cn", - "geoip": [ - "cn", - "private" - ], - "outbound": "direct" - } - ], - "auto_detect_interface": true - } -} diff --git a/sing-box/files/sing-box.init b/sing-box/files/sing-box.init deleted file mode 100644 index f206eeb..0000000 --- a/sing-box/files/sing-box.init +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh /etc/rc.common -# -# Copyright (C) 2022 by nekohasekai -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# - -START=99 -USE_PROCD=1 - -##### ONLY CHANGE THIS BLOCK ###### -PROG=/usr/bin/sing-box # where is sing-box -RES_DIR=/etc/sing-box/ # resource dir / working dir / the dir where you store ip/domain lists -CONF=./config.json # where is the config file, it can be a relative path to $RES_DIR -##### ONLY CHANGE THIS BLOCK ###### - -start_service() { - procd_open_instance - procd_set_param command $PROG run -D $RES_DIR -c $CONF - - procd_set_param user root - procd_set_param limits core="unlimited" - procd_set_param limits nofile="1000000 1000000" - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}" - procd_close_instance - iptables -I FORWARD -o sb-tun+ -j ACCEPT - echo "sing-box is started!" -} - -stop_service() { - service_stop $PROG - iptables -D FORWARD -o sb-tun+ -j ACCEPT - echo "sing-box is stopped!" -} - -reload_service() { - stop - sleep 2s - echo "sing-box is restarted!" - start -} \ No newline at end of file diff --git a/v2ray-core/Makefile b/v2ray-core/Makefile index aad94de..57d9ff8 100644 --- a/v2ray-core/Makefile +++ b/v2ray-core/Makefile @@ -42,13 +42,6 @@ define Package/v2ray-core DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle endef -define Package/v2ray-example - $(call Package/v2ray/template) - TITLE+= (example configs) - DEPENDS:=v2ray-core - PKGARCH:=all -endef - define Package/v2ray-extra $(call Package/v2ray/template) TITLE+= (extra resources) @@ -65,12 +58,6 @@ define Package/v2ray-core/description $(call Package/v2ray/description) endef -define Package/v2ray-example/description - $(call Package/v2ray/description) - - This includes example configuration files for v2ray-core. -endef - define Package/v2ray-extra/description $(call Package/v2ray/description) @@ -78,28 +65,12 @@ define Package/v2ray-extra/description endef define Package/v2ray-core/conffiles -/etc/config/v2ray -/etc/v2ray/ endef define Package/v2ray-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/v2ray - - $(INSTALL_DIR) $(1)/etc/v2ray/ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/v2ray/ - - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_CONF) $(CURDIR)/files/v2ray.conf $(1)/etc/config/v2ray - $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) $(CURDIR)/files/v2ray.init $(1)/etc/init.d/v2ray -endef - -define Package/v2ray-example/install - $(INSTALL_DIR) $(1)/etc/v2ray/ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_socks_vmess.json $(1)/etc/v2ray/ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_vmess_freedom.json $(1)/etc/v2ray/ endef define Package/v2ray-extra/install @@ -108,5 +79,4 @@ define Package/v2ray-extra/install endef $(eval $(call BuildPackage,v2ray-core)) -$(eval $(call BuildPackage,v2ray-example)) $(eval $(call BuildPackage,v2ray-extra)) diff --git a/v2ray-core/files/v2ray.conf b/v2ray-core/files/v2ray.conf deleted file mode 100644 index 6df1e10..0000000 --- a/v2ray-core/files/v2ray.conf +++ /dev/null @@ -1,11 +0,0 @@ - -config v2ray 'enabled' - option enabled '0' - -config v2ray 'config' - option confdir '/etc/v2ray' - list conffiles '/etc/v2ray/config.json' - option datadir '/usr/share/v2ray' - option format 'json' - option memconservative '1' - diff --git a/v2ray-core/files/v2ray.init b/v2ray-core/files/v2ray.init deleted file mode 100755 index e43f511..0000000 --- a/v2ray-core/files/v2ray.init +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=99 - -CONF="v2ray" -PROG="/usr/bin/v2ray" - -start_service() { - config_load "$CONF" - - local enabled - config_get_bool enabled "enabled" "enabled" "0" - [ "$enabled" -eq "0" ] && exit 1 - - local confdir - local conffiles - local datadir - local format - - config_get confdir "config" "confdir" - config_get conffiles "config" "conffiles" - config_get datadir "config" "datadir" "/usr/share/v2ray" - config_get format "config" "format" "json" - config_get_bool memconservative "config" "memconservative" "1" - - procd_open_instance "$CONF" - procd_set_param command "$PROG" run - [ -n "$confdir" ] && procd_append_param command -confdir "$confdir" - [ -n "$conffiles" ] && { - for i in $conffiles - do - procd_append_param command -config "$i" - done - } - [ -n "$format" ] && procd_append_param command -format "$format" - procd_set_param env v2ray.local.asset="$datadir" - [ "$memconservative" -eq "1" ] && procd_append_param env V2RAY_CONF_GEOLOADER="memconservative" - procd_set_param file $conffiles - - procd_set_param limits core="unlimited" - procd_set_param limits nofile="1000000 1000000" - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_set_param respawn - - procd_close_instance -} - -reload_service() { - stop - start -} - -service_triggers() { - procd_add_reload_trigger "$CONF" -} diff --git a/xray-core/Makefile b/xray-core/Makefile index 941bdf0..67f00a4 100644 --- a/xray-core/Makefile +++ b/xray-core/Makefile @@ -38,13 +38,6 @@ define Package/xray-core DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle endef -define Package/xray-example - $(call Package/xray/template) - TITLE+= (example configs) - DEPENDS:=xray-core - PKGARCH:=all -endef - define Package/xray/description Xray, Penetrates Everything. It helps you to build your own computer network. It secures your network connections and thus protects your privacy. @@ -54,12 +47,6 @@ define Package/xray-core/description $(call Package/xray/description) endef -define Package/xray-example/description - $(call Package/xray/description) - - This includes example configuration files for xray-core. -endef - define Package/xray-core/conffiles /etc/xray/ /etc/config/xray @@ -69,21 +56,6 @@ 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 - - $(INSTALL_DIR) $(1)/etc/xray/ - $(INSTALL_DATA) $(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 -endef - -define Package/xray-example/install - $(INSTALL_DIR) $(1)/etc/xray/ - $(INSTALL_DATA) $(CURDIR)/files/vpoint_socks_vmess.json $(1)/etc/xray/ - $(INSTALL_DATA) $(CURDIR)/files/vpoint_vmess_freedom.json $(1)/etc/xray/ endef $(eval $(call BuildPackage,xray-core)) -$(eval $(call BuildPackage,xray-example)) diff --git a/xray-core/files/config.json.example b/xray-core/files/config.json.example deleted file mode 100644 index 710bb1b..0000000 --- a/xray-core/files/config.json.example +++ /dev/null @@ -1,144 +0,0 @@ -// Config file of Xray. This file follows standard JSON format, with comments support. -// Uncomment entries below to satisfy your needs. Also read our manual for more detail at -// https://xtls.github.io/en/config/ -{ - "log": { - // By default, Xray writes access log to stdout. - // "access": "/path/to/access/log/file", - - // By default, Xray write error log to stdout. - // "error": "/path/to/error/log/file", - - // Log level, one of "debug", "info", "warning", "error", "none" - "loglevel": "warning" - }, - // List of inbound proxy configurations. - "inbounds": [{ - // Port to listen on. You may need root access if the value is less than 1024. - "port": 1080, - - // IP address to listen on. Change to "0.0.0.0" to listen on all network interfaces. - "listen": "127.0.0.1", - - // Tag of the inbound proxy. May be used for routing. - "tag": "socks-inbound", - - // Protocol name of inbound proxy. - "protocol": "socks", - - // Settings of the protocol. Varies based on protocol. - "settings": { - "auth": "noauth", - "udp": false, - "ip": "127.0.0.1" - }, - - // Enable sniffing on TCP connection. - "sniffing": { - "enabled": true, - // Target domain will be overriden to the one carried by the connection, if the connection is HTTP or HTTPS. - "destOverride": ["http", "tls"] - } - }], - // List of outbound proxy configurations. - "outbounds": [{ - // Protocol name of the outbound proxy. - "protocol": "freedom", - - // Settings of the protocol. Varies based on protocol. - "settings": {}, - - // Tag of the outbound. May be used for routing. - "tag": "direct" - },{ - "protocol": "blackhole", - "settings": {}, - "tag": "blocked" - }], - - // Transport is for global transport settings. If you have multiple transports with same settings - // (say mKCP), you may put it here, instead of in each individual inbound/outbounds. - //"transport": {}, - - // Routing controls how traffic from inbounds are sent to outbounds. - "routing": { - "domainStrategy": "IPOnDemand", - "rules":[ - { - // Blocks access to private IPs. Remove this if you want to access your router. - "type": "field", - "ip": ["geoip:private"], - "outboundTag": "blocked" - }, - { - // Blocks major ads. - "type": "field", - "domain": ["geosite:category-ads"], - "outboundTag": "blocked" - } - ] - }, - - // Dns settings for domain resolution. - "dns": { - // Static hosts, similar to hosts file. - "hosts": { - // Match v2ray.com to another domain on CloudFlare. This domain will be used when querying IPs for v2ray.com. - "domain:v2ray.com": "www.vicemc.net", - - // The following settings help to eliminate DNS poisoning in mainland China. - // It is safe to comment these out if this is not the case for you. - "domain:github.io": "pages.github.com", - "domain:wikipedia.org": "www.wikimedia.org", - "domain:shadowsocks.org": "electronicsrealm.com" - }, - "servers": [ - "1.1.1.1", - { - "address": "114.114.114.114", - "port": 53, - // List of domains that use this DNS first. - "domains": [ - "geosite:cn" - ] - }, - "8.8.8.8", - "localhost" - ] - }, - - // Policy controls some internal behavior of how Xray handles connections. - // It may be on connection level by user levels in 'levels', or global settings in 'system.' - "policy": { - // Connection policys by user levels - "levels": { - "0": { - "uplinkOnly": 0, - "downlinkOnly": 0 - } - }, - "system": { - "statsInboundUplink": false, - "statsInboundDownlink": false, - "statsOutboundUplink": false, - "statsOutboundDownlink": false - } - }, - - // Stats enables internal stats counter. - // This setting can be used together with Policy and Api. - //"stats":{}, - - // Api enables gRPC APIs for external programs to communicate with Xray instance. - //"api": { - //"tag": "api", - //"services": [ - // "HandlerService", - // "LoggerService", - // "StatsService" - //] - //}, - - // You may add other entries to the configuration, but they will not be recognized by Xray. - "other": {} -} diff --git a/xray-core/files/vpoint_socks_vmess.json b/xray-core/files/vpoint_socks_vmess.json deleted file mode 100644 index 789cd27..0000000 --- a/xray-core/files/vpoint_socks_vmess.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "log": { - "loglevel": "warning" - }, - "inbounds": [{ - "port": 1080, - "listen": "127.0.0.1", - "protocol": "socks", - "settings": { - "auth": "noauth", - "udp": false, - "ip": "127.0.0.1" - } - }], - "outbounds": [{ - "protocol": "freedom", - "settings": {}, - "tag": "direct" - }], - "policy": { - "levels": { - "0": {"uplinkOnly": 0} - } - } -} diff --git a/xray-core/files/vpoint_vmess_freedom.json b/xray-core/files/vpoint_vmess_freedom.json deleted file mode 100644 index 41c7e30..0000000 --- a/xray-core/files/vpoint_vmess_freedom.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "inbounds": [{ - "port": 10086, - "protocol": "vmess", - "settings": { - "clients": [ - { - "id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297", - "level": 1 - } - ] - } - }], - "outbounds": [{ - "protocol": "freedom", - "settings": {} - },{ - "protocol": "blackhole", - "settings": {}, - "tag": "blocked" - }], - "routing": { - "rules": [ - { - "type": "field", - "ip": ["geoip:private"], - "outboundTag": "blocked" - } - ] - } -} diff --git a/xray-core/files/xray.conf b/xray-core/files/xray.conf deleted file mode 100644 index 362fbac..0000000 --- a/xray-core/files/xray.conf +++ /dev/null @@ -1,11 +0,0 @@ - -config xray 'enabled' - option enabled '0' - -config xray 'config' - option confdir '/etc/xray' - list conffiles '/etc/xray/config.json' - option datadir '/usr/share/v2ray' - option dialer '' - option format 'json' - diff --git a/xray-core/files/xray.init b/xray-core/files/xray.init deleted file mode 100755 index 356d1b2..0000000 --- a/xray-core/files/xray.init +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=99 - -CONF="xray" -PROG="/usr/bin/xray" - -start_service() { - config_load "$CONF" - - local enabled - config_get enabled "enabled" "enabled" "0" - [ "$enabled" -eq "0" ] && exit 1 - - local confdir - local conffiles - local datadir - local dialer - local format - - config_get confdir "config" "confdir" - config_get conffiles "config" "conffiles" - config_get datadir "config" "datadir" "/usr/share/v2ray" - config_get dialer "config" "dialer" - config_get format "config" "format" "json" - - procd_open_instance "$CONF" - procd_set_param command "$PROG" run - [ -n "$confdir" ] && procd_append_param command -confdir "$confdir" - [ -n "$conffiles" ] && { - for i in $conffiles - do - procd_append_param command -config "$i" - done - } - [ -n "$format" ] && procd_append_param command -format "$format" - [ -n "$dialer" ] && procd_set_param env XRAY_BROWSER_DIALER="$dialer" - procd_set_param env XRAY_LOCATION_ASSET="$datadir" - procd_set_param file $conffiles - - procd_set_param limits core="unlimited" - procd_set_param limits nofile="1000000 1000000" - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_set_param respawn - - procd_close_instance -} - -reload_service() { - stop - start -} - -service_triggers() { - procd_add_reload_trigger "$CONF" -}