From 5fd058b6fd1200f53e02eeafb57ca61b358a5d9c Mon Sep 17 00:00:00 2001 From: Dimasssss Date: Sun, 5 Apr 2026 14:49:31 +0300 Subject: [PATCH] Update install.sh - Add -d/--domain **Example usage:** `./install.sh -d example.com` `./install.sh --domain example.com` --- install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 9f679aa..cb930d0 100644 --- a/install.sh +++ b/install.sh @@ -20,6 +20,13 @@ TARGET_VERSION="${VERSION:-latest}" while [ $# -gt 0 ]; do case "$1" in -h|--help) ACTION="help"; shift ;; + -d|--domain) + if [ "$#" -lt 2 ] || [ -z "$2" ]; then + printf '[ERROR] %s requires a domain argument.\n' "$1" >&2 + exit 1 + fi + TLS_DOMAIN="$2" + shift 2 ;; uninstall|--uninstall) if [ "$ACTION" != "purge" ]; then ACTION="uninstall"; fi shift ;; @@ -52,11 +59,12 @@ cleanup() { trap cleanup EXIT INT TERM show_help() { - say "Usage: $0 [ | install | uninstall | purge | --help ]" + say "Usage: $0 [ | install | uninstall | purge ] [ -d ] [ --help ]" say " Install specific version (e.g. 3.3.15, default: latest)" say " install Install the latest version" say " uninstall Remove the binary and service (keeps config and user)" say " purge Remove everything including configuration, data, and user" + say " -d, --domain Set TLS domain (default: petrovich.ru)" exit 0 }