From fc57b79de21a2092bc02a27be08bdbef041bc3fe Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 29 Jun 2024 13:34:48 -0700 Subject: feat: copy insp mirrorlists to studio when in same network --- sh/upd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sh/upd') diff --git a/sh/upd b/sh/upd index a126220..8e7bfa5 100755 --- a/sh/upd +++ b/sh/upd @@ -3,7 +3,9 @@ all () { fast clean - if [ "$hostname" != xyzpp ] && [ "$hostname" != xyzaa ]; then + # don't run reflector if it is pp or aa or {it is studio and insp is in the same network} + # somehow ping local hostname via ipv6 is very slow, so I use ipv4 to ping + if ! { [ "$hostname" = xyzpp ] || [ "$hostname" = xyzaa ] || { [ "$hostname" = xyzstudio ] && ping -4qc1 xyzinsp > /dev/null;};}; then refl fi if [ "$hostname" = xyzia ]; then @@ -242,6 +244,11 @@ monthly_misc () { echo 'Wait for xyzaa sudo prompt and enter password:' ssh -t aa 'sudo mv /tmp/mirrorlist /etc/pacman.d/mirrorlist && sudo chown root:root /etc/pacman.d/mirrorlist' fi + # if insp can ping studio, which means insp and studio is in the same network + if ping -4qc1 xyzstudio > /dev/null && scp /etc/pacman.d/mirrorlist studio:/tmp; then + echo 'Wait for studio sudo prompt and enter password:' + ssh -t studio 'sudo mv /tmp/mirrorlist /etc/pacman.d/mirrorlist && sudo chown root:root /etc/pacman.d/mirrorlist' + fi fi } -- cgit v1.2.3-70-g09d2