Browse Source

new: [0km] add support of ``--ignore-{domain,ping}-check`` options to pass to ``vps`` command

pull/8/head
Valentin Lab 9 months ago
parent
commit
4fcbb0007b
  1. 35
      bin/0km

35
bin/0km

@ -757,13 +757,25 @@ vps_install_backup() {
vps_connection_check "$vps" </dev/null || return 1
read-0 admin server
if ! type=$(ssh:run "root@$vps" -- vps get-type); then
if ! type=$(ssh:run "root@$vps" -- vps get-type </dev/null); then
err "Could not get type."
return 1
fi
if ! out=$(ssh:run "root@$vps" -- vps install backup "$server" 2>&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[@]}"
}

Loading…
Cancel
Save