Skip to content

Commit

Permalink
Support use environment variable pass in config file name.
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Dec 4, 2021
1 parent 0bdc7ec commit a002f99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion router/opt/etc/apply_iptables_rule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
alias iptables='/opt/sbin/iptables'
fi

config_file=/opt/etc/v2ray.json
config_file=${v2ray_config-/opt/etc/v2ray.json}

local_v2ray_port=$(cat $config_file |grep '"inbounds"' -A10 |grep '"protocol" *: *"dokodemo-door"' -A10 |grep -o '"port": [0-9]*,' |grep -o '[0-9]*')

Expand Down
2 changes: 1 addition & 1 deletion router/opt/etc/debug_v2ray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ else
systemctl stop v2ray
fi

/opt/sbin/v2ray -config /opt/etc/v2ray.json
/opt/sbin/v2ray -config ${v2ray_config-/opt/etc/v2ray.json}
2 changes: 1 addition & 1 deletion router/opt/etc/toggle_proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function replace_multiline1 () {
# 因为即使关闭透明代理,仍可以通过浏览器插件使用 v2ray 的 socks 代理或 http 代理服务。

dnsmasq_dir=/opt/etc/dnsmasq.d
v2ray_config=/opt/etc/v2ray.json
v2ray_config=${v2ray_config-/opt/etc/v2ray.json}

function clean_dnsmasq_config () {
if [ -d "$dnsmasq_dir" ]; then
Expand Down

0 comments on commit a002f99

Please sign in to comment.