feat: add PROXY_HOST to update
This commit is contained in:
parent
d43a5aa68a
commit
e591a7117d
16
update
16
update
@ -1,27 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "${MOVIEPILOT_CN_UPDATE}" = "true" ]; then
|
if [ -n "${PROXY_HOST}" ]; then
|
||||||
GITHUB_URL="https://ghproxy.com/https://github.com"
|
CURL_OPTIONS="-sL -x ${PROXY_HOST}"
|
||||||
GITHUBUSERCONTENT_URL="https://ghproxy.com/https://raw.githubusercontent.com"
|
echo "使用代理更新程序"
|
||||||
else
|
else
|
||||||
GITHUB_URL="https://github.com"
|
CURL_OPTIONS="-sL"
|
||||||
GITHUBUSERCONTENT_URL="https://raw.githubusercontent.com"
|
echo "不使用代理更新程序"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
old_version=$(cat /app/version.py)
|
old_version=$(cat /app/version.py)
|
||||||
if [[ "${old_version}" == *APP_VERSION* ]]; then
|
if [[ "${old_version}" == *APP_VERSION* ]]; then
|
||||||
current_version=v$(echo ${old_version} | sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
current_version=v$(echo ${old_version} | sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
||||||
echo "当前版本号:${current_version}"
|
echo "当前版本号:${current_version}"
|
||||||
new_version=$(curl -s "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest" | jq -r .tag_name)
|
new_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest" | jq -r .tag_name)
|
||||||
if [[ "${new_version}" == *v* ]]; then
|
if [[ "${new_version}" == *v* ]]; then
|
||||||
release_version=${new_version}
|
release_version=${new_version}
|
||||||
echo "最新版本号:${release_version}"
|
echo "最新版本号:${release_version}"
|
||||||
if [ "${current_version}" != "${release_version}" ]; then
|
if [ "${current_version}" != "${release_version}" ]; then
|
||||||
echo "发现新版本,开始更新程序..."
|
echo "发现新版本,开始更新程序..."
|
||||||
curl -sL "${GITHUB_URL}/jxxghp/MoviePilot/archive/refs/tags/${release_version}.zip" | busybox unzip -d /tmp -
|
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot/archive/refs/tags/${release_version}.zip" | busybox unzip -d /tmp -
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "后端下载成功"
|
echo "后端下载成功"
|
||||||
curl -sL "${GITHUB_URL}/jxxghp/MoviePilot-Frontend/releases/download/${release_version}/dist.zip" | busybox unzip -d /tmp -
|
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${release_version}/dist.zip" | busybox unzip -d /tmp -
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "前端下载成功"
|
echo "前端下载成功"
|
||||||
rm -rf /app
|
rm -rf /app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user