From 39bb0d50ecbdd6d9669a01c7d2c170ed07291f76 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Sat, 3 Oct 2020 10:58:11 +0800 Subject: Add basic features - Subscription support - V2ray-core upgrade support --- update.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 update.sh (limited to 'update.sh') diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..720ea90 --- /dev/null +++ b/update.sh @@ -0,0 +1,17 @@ +#!/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!" -- cgit v1.2.3