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

42 lines
872 B
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
detect_arch() {
case "${ARCH}" in
x86_64) echo "amd64" ;;
arm64 | aarch64) echo "arm64" ;;
*) echo "unknown" ;;
esac
}
run() {
local arch=$(detect_arch)
if [ "${arch}" == "unknown" ]; then
error "Unsupported architecture: ${ARCH}"
fi
TARGET="acepanel-helper-${arch}"
BIN_NAME="acepanel-helper"
dl "$(pwd)" "/${TARGET}"
mv "${TARGET}" "${BIN_NAME}"
chmod +x "$BIN_NAME"
if [ ! -t 0 ]; then
exec </dev/tty # 尝试恢复终端输入
fi
./"$BIN_NAME" "$@"
rm -f "$BIN_NAME"
}
run "$@"