Files
gitlab-instance-0a899031_do…/install-oneclick.sh
2026-03-29 02:14:17 -05:00

43 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 一键安装入口Ubuntu/Debian 系 + 常见 ARM/x86_64再调用现有 install-allhub + business
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
log() {
printf '[oneclick] %s\n' "$*"
}
if [ ! -f /etc/os-release ]; then
log "未找到 /etc/os-release仅支持 Debian/Ubuntu 系。"
exit 1
fi
# shellcheck source=/dev/null
. /etc/os-release
ID_LIKE="${ID_LIKE:-}"
if ! echo "${ID:-} ${ID_LIKE}" | grep -qiE 'debian|ubuntu'; then
log "当前发行版: ${PRETTY_NAME:-unknown}"
log "脚本仅在 Debian/Ubuntu 及其衍生版上测试;如需其它系统请直接阅读 scripts/linux/*.sh 手工执行。"
exit 1
fi
ARCH="$(uname -m 2>/dev/null || true)"
case "${ARCH}" in
x86_64 | amd64 | aarch64 | arm64 | armv7l | armv6l) ;;
*)
log "未识别的机器架构: ${ARCH:-?},将继续尝试安装(请自行确认依赖是否可用)。"
;;
esac
log "ROOT_DIR=${ROOT_DIR}"
log "架构=${ARCH} 系统=${PRETTY_NAME:-$ID}"
if [ ! -x "${ROOT_DIR}/install-all.sh" ]; then
log "缺少可执行的 install-all.sh"
exit 1
fi
exec bash "${ROOT_DIR}/install-all.sh" "$@"