Files
gitlab-instance-0a899031_sh/d2ypp2/install-oneclick.sh
root efa5533032 s
2026-05-18 08:36:28 +00:00

48 lines
1.2 KiB
Bash
Executable File
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}"
INSTALL_ALL="${ROOT_DIR}/install-all.sh"
if [ ! -f "${INSTALL_ALL}" ]; then
log "缺少 install-all.sh"
exit 1
fi
if [ ! -x "${INSTALL_ALL}" ]; then
log "install-all.sh 未设置执行位,改用 bash 直接执行"
fi
exec bash "${INSTALL_ALL}" "$@"