summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xselect.sh23
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