From 4fcbb0007bbaa03fb0d154fba84c1f84291301de Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Fri, 5 Apr 2024 11:29:55 +0200 Subject: [PATCH] new: [0km] add support of ``--ignore-{domain,ping}-check`` options to pass to ``vps`` command --- bin/0km | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/bin/0km b/bin/0km index 3cc5651..e913d1b 100755 --- a/bin/0km +++ b/bin/0km @@ -757,13 +757,25 @@ vps_install_backup() { vps_connection_check "$vps" &1); then - err "Command 'vps install backup $server' on $vps failed:" + backup_opts=() + local opt + while read-0 opt; do + case "$opt" in + --ignore-domain-check|--ignore-ping-check) + backup_opts+=("$opt") + ;; + *) + err "Unknown option '$opt'." + return 1 + ;; + esac + done + if ! out=$(ssh:run "root@$vps" -- vps install backup "$server" "${backup_opts[@]}" 2>&1); then + err "Command 'vps install backup $server ${backup_opts[@]}' on $vps failed:" echo "$out" | prefix " ${DARKGRAY}|${NORMAL} " >&2 return 1 fi @@ -1072,6 +1084,11 @@ cmdline.spec:vps-install:cmd:backup:run() { : :posarg: BACKUP_TARGET 'Backup target. (ie: myadmin@backup.domain.org:10023/256)' + : :optfla: --ignore-domain-check \ + "Allow to bypass the domain check in + compose file (only used in compose + installation)." + : :optfla: --ignore-ping-check "Allow to bypass the ping check of host." : :posarg: [VPS...] 'Target host(s) to check' @@ -1088,7 +1105,15 @@ cmdline.spec:vps-install:cmd:backup:run() { admin=${BACKUP_TARGET%%@*} server=${BACKUP_TARGET#*@} - p0 "$admin" "$server" | + opts=() + + [ -n "$opt_ignore_ping_check" ] && + opts+=("--ignore-ping-check") + + [ -n "$opt_ignore_domain_check" ] && + opts+=("--ignore-domain-check") + + p0 "$admin" "$server" "${opts[@]}" | vps_mux vps_install_backup "${VPS[@]}" }