X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=btrbk-run;fp=btrbk-run;h=b4bd302918c0a559328ee8d3fa8a7e07c95f87e9;hb=b5c66cce3ad6c20280958da89f90fb13f74bd721;hp=ae16266fbe149394753e8810657c422db7c3d9ce;hpb=f68d910fd20082a8c1bacd511b321296f328a799;p=distro-setup diff --git a/btrbk-run b/btrbk-run index ae16266..b4bd302 100644 --- a/btrbk-run +++ b/btrbk-run @@ -113,12 +113,21 @@ add-x3-target() { fi } -add-wireless-target-h() { - if ping -q -c1 -w1 $h.b8.nz &>/dev/null; then - targets+=($h.b8.nz) - elif ping -q -c1 -w1 ${h}w.b8.nz &>/dev/null; then - targets+=(${h}w.b8.nz) +add-wireless-target() { + local host + if [[ ! $1 ]]; then + set -- $h fi + for host; do + # c = cabled, w = wireless + if ping -q -c1 -w1 ${host}c.b8.nz &>/dev/null; then + targets+=(${host}c.b8.nz) + elif ping -q -c1 -w1 $host.b8.nz &>/dev/null; then + targets+=($host.b8.nz) + elif ping -q -c1 -w1 ${host}w.b8.nz &>/dev/null; then + targets+=(${host}w.b8.nz) + fi + done } qconf() { @@ -288,8 +297,7 @@ if $kd_spread; then fi cmd_arg=resume preserve_arg=-p - h=sy - add-wireless-target-h + add-wireless-target sy so fi if [[ ! $cmd_arg ]]; then @@ -370,7 +378,7 @@ if [[ ! -v targets && ! $source ]]; then ) for h in ${wireless_home_hosts[@]}; do if [[ $HOSTNAME != "$h" ]]; then - add-wireless-target-h + add-wireless-target fi done elif $at_work; then @@ -612,7 +620,7 @@ df --output=size,pcent / | tail -n1" min_root_kb=$(( 1024 * 1024 * 200 )) # 200 gb tmp=$(( root_size < min_root_kb )) if (( tmp )); then - e "warning: $h: root_size=$root_zie < 200gb, perhaps it is booted to bootstrap vol. skipping for now" + e "warning: $h: root_size=$root_size < 200gb, perhaps it is booted to bootstrap vol. skipping for now" continue fi