Skip to content

Commit

Permalink
Update openclash_update.sh
Browse files Browse the repository at this point in the history
使用本地代理下载
  • Loading branch information
Septrum101 authored Feb 28, 2020
1 parent fb1a57d commit 9445629
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LAST_OPVER="/tmp/openclash_last_version"
LAST_VER=$(sed -n 1p "$LAST_OPVER" 2>/dev/null |sed "s/^v//g")
if [ "$(sed -n 1p /etc/openclash/openclash_version 2>/dev/null)" != "$(sed -n 1p $LAST_OPVER 2>/dev/null)" ] && [ -f "$LAST_OPVER" ]; then
echo "开始下载 OpenClash-$LAST_VER ..." >$START_LOG
curl -sL --connect-timeout 10 --retry 5 https://github.com/vernesong/OpenClash/releases/download/v"$LAST_VER"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk >/dev/null 2>&1
curl -sL --connect-timeout 10 --retry 5 -x http://127.0.0.1:$(uci get openclash.config.http_port 2>/dev/null) https://github.com/vernesong/OpenClash/releases/download/v"$LAST_VER"/luci-app-openclash_"$LAST_VER"_all.ipk -o /tmp/openclash.ipk >/dev/null 2>&1
if [ "$?" -eq "0" ] && [ -s "/tmp/openclash.ipk" ]; then
echo "OpenClash-$LAST_VER 下载成功,开始更新,更新过程请不要刷新页面和进行其他操作..." >$START_LOG
cat > /tmp/openclash_update.sh <<"EOF"
Expand Down Expand Up @@ -56,4 +56,4 @@ else
echo "${LOGTIME} OpenClash Version No Change, Do Nothing" >>$LOG_FILE
sleep 5
echo "" >$START_LOG
fi
fi

0 comments on commit 9445629

Please sign in to comment.