#!/bin/bash cd "$(dirname "$0")" V2RAY_HOME=${V2RAY_HOME:-$(pwd)} V2RAY_CONFIG_DIR=${V2RAY_CONFIG_DIR:-$(pwd)} V2RAY_LINK="$V2RAY_CONFIG_DIR/link" V2RAY_SUB="$V2RAY_CONFIG_DIR/subscription" [[ -f $V2RAY_LINK ]] \ || { echo "Please put subscription link in $V2RAY_LINK." >&2; exit 1; } echo "Updating subscription..." xargs -i < "$V2RAY_LINK" curl "{}" -o "$V2RAY_SUB" || \ { echo "Cannot update subscription, check your network." >&2; exit 1; } echo "Subscription updated!"