From 860de2aeabf2b21f65ad1e6b299c0a99f649c718 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Wed, 27 Jan 2021 13:12:55 +0800 Subject: Add config select script --- select.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 select.sh 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 -- cgit v1.2.3