diff options
author | Jordan Gong <jordan.gong@protonmail.com> | 2021-01-27 13:12:55 +0800 |
---|---|---|
committer | Jordan Gong <jordan.gong@protonmail.com> | 2021-01-27 13:12:55 +0800 |
commit | 860de2aeabf2b21f65ad1e6b299c0a99f649c718 (patch) | |
tree | 19bd0bf5f35a5fc7bbfea1e5f5e44fd9ea69e148 /select.sh | |
parent | a866f38601517257dfd5d6cc55e2d133e22105fb (diff) |
Diffstat (limited to 'select.sh')
-rwxr-xr-x | select.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/select.sh b/select.sh new file mode 100755 index 0000000..1cc08c4 --- /dev/null +++ b/select.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +cd "$(dirname "$0")" + +V2RAY_CONFIG_DIR=${V2RAY_CONFIG_DIR:-$(pwd)} +V2RAY_SUB="$V2RAY_CONFIG_DIR/subscription" + +if [[ "$#" -ne 0 && -f "$1" ]] +then + cp -f "$1" "$V2RAY_CONFIG_DIR/config.json" +else + if [[ "$#" -eq 0 ]] + then + [[ -f "$V2RAY_SUB" ]] || "$V2RAY_HOME/update.sh" || exit 1 + "$V2RAY_HOME/vmess2json/vmess2json.py" \ + < "$V2RAY_SUB" \ + --inbounds "http:10809,socks:10808" \ + --output "$V2RAY_CONFIG_DIR/config.json" + else + echo "$1 does not exist." >&2 + exit 1 + fi +fi |