44 lines
1.7 KiB
Bash
44 lines
1.7 KiB
Bash
#!/bin/bash
|
|
# ServerStack entry point.
|
|
#
|
|
# This script is now a THIN ENTRY POINT only. It bootstraps the environment
|
|
# and orchestrates the install workflow by calling main() from
|
|
# core/workflow.sh. All business logic (system detection, parameter
|
|
# parsing, menu, download, install, config, services, summary) has been moved
|
|
# into focused modules under lib/ (shared functions), core/ (orchestration)
|
|
# and modules/ (per-software installers).
|
|
#
|
|
# Usage and behavior are unchanged from the previous install.sh.
|
|
|
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
|
|
|
# Ensure cwd is the project root so all relative sources work exactly as before.
|
|
# oneinstack_dir is the project root (one level up from bin/); falling back to
|
|
# "$0" keeps this working even when readlink -f is unavailable.
|
|
oneinstack_dir="$(cd "$(dirname "$(readlink -f "$0" 2>/dev/null || echo "$0")")/.." && pwd)"
|
|
cd "${oneinstack_dir}" || exit 1
|
|
|
|
# Load framework modules (function definitions only; nothing runs yet).
|
|
. ./lib/loader.sh
|
|
. ./lib/log.sh
|
|
. ./core/environment.sh
|
|
. ./core/init.sh
|
|
. ./core/argument.sh
|
|
. ./core/menu.sh
|
|
. ./core/validator.sh
|
|
. ./core/installer.sh
|
|
. ./core/service.sh
|
|
. ./core/summary.sh
|
|
. ./core/workflow.sh
|
|
|
|
# Unified exception handling (cleanup / rollback on exit, interrupt, terminate).
|
|
# NOTE: ERR is intentionally NOT trapped. Binding ERR would fire trap_handler on
|
|
# every non-zero command (even benign ones outside if/&&/||) and auto-write an
|
|
# [ERROR] line to install.log, changing the original log output. Logging is done
|
|
# explicitly via log_error/error_exit; this trap only guarantees best-effort
|
|
# cleanup (currently no-ops) so the happy path and its logs stay faithful.
|
|
trap 'trap_handler' EXIT INT TERM
|
|
|
|
# Run the install workflow.
|
|
main "$@"
|