27 lines
585 B
Bash
27 lines
585 B
Bash
#!/usr/bin/env sh
|
|
set -eu
|
|
|
|
PACKAGE_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
ORCHESTRATOR="$PACKAGE_DIR/orchestrator/hy2xs-orchestrator"
|
|
|
|
log() {
|
|
printf '[hy2xs-install] %s\n' "$*"
|
|
}
|
|
|
|
fail() {
|
|
printf '[hy2xs-install] ERROR: %s\n' "$*" >&2
|
|
exit 1
|
|
}
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
fail "HY2XS install must run as root."
|
|
fi
|
|
|
|
if [ ! -x "$ORCHESTRATOR" ]; then
|
|
fail "Missing executable orchestrator artifact: $ORCHESTRATOR"
|
|
fi
|
|
|
|
log "package directory: $PACKAGE_DIR"
|
|
log "starting install-only orchestrator"
|
|
exec "$ORCHESTRATOR" install --package-dir "$PACKAGE_DIR" "$@"
|