#!/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