fix update
This commit is contained in:
parent
71c36881fb
commit
3178d9da88
24
update
24
update
@ -1,13 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Common function to download and unzip files
|
||||
# 下载及解压
|
||||
download_and_unzip() {
|
||||
url="$1"
|
||||
target_dir="$2"
|
||||
echo "正在下载 ${url}..."
|
||||
curl ${CURL_OPTIONS} "$url" | busybox unzip -d /tmp -
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "下载成功"
|
||||
if [ -e /tmp/MoviePilot-* ]; then
|
||||
mv /tmp/MoviePilot-* /tmp/${target_dir}
|
||||
fi
|
||||
@ -16,7 +15,7 @@ download_and_unzip() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Common function to install backend and download resources
|
||||
# 下载程序资源,$1: 后端版本路径
|
||||
install_backend_and_download_resources() {
|
||||
download_and_unzip "https://github.com/jxxghp/MoviePilot/archive/refs/${1}" "App"
|
||||
if [ $? -eq 0 ]; then
|
||||
@ -36,13 +35,22 @@ install_backend_and_download_resources() {
|
||||
download_and_unzip "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${frontend_version}/dist.zip" "dist"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "前端程序下载成功"
|
||||
find /app/* -type d ! -path "/app/app/plugins" -exec rm -rf {} \;
|
||||
find /app/* -type f ! -path "/app/app/plugins/*" -exec rm -f {} \;
|
||||
mv -f /tmp/App/* /app/
|
||||
# 备份插件目录
|
||||
mv -f /app/app/plugins /plugins
|
||||
# 清空目录
|
||||
rm -rf /app
|
||||
# 后端程序
|
||||
mv -f /tmp/App /app
|
||||
# 恢复插件目录
|
||||
mv -f /plugins /app/app/plugins
|
||||
# 插件仓库
|
||||
mv -f /tmp/Plugins/plugins/* /app/app/plugins/
|
||||
# 资源包
|
||||
mv -f /tmp/Resources/resources/* /app/app/helper/
|
||||
# 前端程序
|
||||
rm -rf /public
|
||||
mv /tmp/dist /public
|
||||
mv -f /tmp/Plugins/plugins/* /app/app/plugins/
|
||||
mv -f /tmp/Resources/resources/* /app/app/helper/
|
||||
# 清理临时目录
|
||||
rm -rf /tmp/*
|
||||
echo "程序更新成功,前端版本:${frontend_version},后端版本:${1}"
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user