Files
download/minio/update.sh
耗子 758e1c8799
All checks were successful
Generate Checksums / checksums (push) Successful in 46s
feat: 清理提交
2026-01-31 07:03:45 +08:00

52 lines
1.1 KiB
Bash

#!/bin/bash
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
source <(curl -f -s --connect-timeout 10 --retry 3 https://dl.acepanel.net/public.sh)
if [ $? -ne 0 ]; then
echo "Download public.sh failed, please check the network or try again later."
exit 1
fi
channel=${1}
version=${2}
minio_path="${setup_path}/server/minio"
# 架构判断
if [ ${ARCH} == "x86_64" ]; then
minio_file="minio-${version}-amd64.7z"
elif [ ${ARCH} == "aarch64" ]; then
minio_file="minio-${version}-arm64.7z"
else
error "Unsupported architecture"
fi
# 下载
cd ${minio_path}
dl "${minio_path}" "/minio/${minio_file}"
# 解压
cd ${minio_path}
7z x ${minio_file}
rm -f ${minio_file}
# 替换文件
systemctl stop minio
rm -f minio
mv minio-${version}-* minio
if [ ! -f "${minio_path}/minio" ]; then
error "minio extraction failed"
fi
chown -R minio:minio ${minio_path}/minio
chmod -R 700 ${minio_path}/minio
systemctl start minio
if [ "$?" != "0" ]; then
error "Failed to start"
fi
acepanel app write minio ${channel} ${version}
echo -e $HR
echo "Upgrade successful"
echo -e $HR