From b805357f537be5efca90bfdba4b10fa41e5db271 Mon Sep 17 00:00:00 2001 From: Jeremy McClure Date: Wed, 29 Jul 2026 10:34:46 -0400 Subject: [PATCH] netbird-install-update: add --help option with usage, options, and examples --- .../netbird-install-update.sh | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/netbird-install-update/netbird-install-update.sh b/netbird-install-update/netbird-install-update.sh index 9e3681b..cd9f690 100755 --- a/netbird-install-update/netbird-install-update.sh +++ b/netbird-install-update/netbird-install-update.sh @@ -74,8 +74,47 @@ print_step() { echo -e " ${DIM}•${NC} $1" } +print_usage() { + cat < Deploy to a single host via SSH + --hosts-file, --file Deploy to multiple hosts from a file + --timer Install a systemd auto-update timer + --time Timer schedule (systemd OnCalendar format, default: daily) + -p, --password Sudo password for remote hosts (used with --ssh or --hosts-file) + +Hosts file format (one per line): + hostname_or_ip [sudo_password] + +Examples: + # Local install/update + sudo ./netbird-install-update.sh + + # Deploy to a single host via SSH + ./netbird-install-update.sh --ssh user@hostname + + # Deploy to multiple hosts from a file + ./netbird-install-update.sh --hosts-file hosts.txt + + # Deploy with auto-update timer + ./netbird-install-update.sh --ssh user@hostname --timer --time "weekly" + + # Multi-host deployment with default sudo password + ./netbird-install-update.sh --hosts-file hosts.txt --password "mypass" +EOF + exit 0 +} + while [[ $# -gt 0 ]]; do case "$1" in + -h|--help) + print_usage + ;; --ssh) SSH_HOST="$2" shift 2