feat(upgrade): add --port flag to change web UI host port on upgrade
Allows changing the host port at upgrade time: curl ... | sudo bash -s -- --upgrade --port 9090 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3b3de281f6
commit
504242308c
1 changed files with 7 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
|||
# Usage:
|
||||
# sudo bash upgrade.sh # latest from ghcr.io
|
||||
# sudo bash upgrade.sh --image TAG # pin a specific image tag
|
||||
# sudo bash upgrade.sh --port PORT # change the web UI host port
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" &>/dev/null && pwd)"
|
||||
|
|
@ -20,9 +21,11 @@ die() { printf '[manage-server] error: %s\n' "$*" >&2; exit 1; }
|
|||
|
||||
# ── arg parsing ───────────────────────────────────────────────────────────
|
||||
IMAGE=""
|
||||
PORT=""
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--image) IMAGE="$2"; shift 2 ;;
|
||||
--port) PORT="$2"; shift 2 ;;
|
||||
-h|--help) grep '^#' "$0" | sed 's/^# //;s/^#//'; exit 0 ;;
|
||||
*) die "unknown flag: $1" ;;
|
||||
esac
|
||||
|
|
@ -39,6 +42,10 @@ if [[ -n "$IMAGE" ]]; then
|
|||
sed -i "s|^TRITON_MANAGE_IMAGE=.*|TRITON_MANAGE_IMAGE=$IMAGE|" .env
|
||||
info "pinned image to $IMAGE"
|
||||
fi
|
||||
if [[ -n "$PORT" ]]; then
|
||||
sed -i "s|^TRITON_MANAGE_HOST_PORT=.*|TRITON_MANAGE_HOST_PORT=$PORT|" .env
|
||||
info "host port set to $PORT"
|
||||
fi
|
||||
|
||||
# ── pre-upgrade DB backup ─────────────────────────────────────────────────
|
||||
case "$(uname -s)" in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue