diff options
| author | Xiao Pan <gky44px1999@gmail.com> | 2024-06-29 13:34:48 -0700 | 
|---|---|---|
| committer | Xiao Pan <gky44px1999@gmail.com> | 2024-06-29 13:34:48 -0700 | 
| commit | fc57b79de21a2092bc02a27be08bdbef041bc3fe (patch) | |
| tree | f30fb9902eb3f6f51238ac9586d9348a6329ae3b /sh/upd | |
| parent | 689c09af1873ce08eed57a5d32a0895096d0fe55 (diff) | |
feat: copy insp mirrorlists to studio when in same network
Diffstat (limited to 'sh/upd')
| -rwxr-xr-x | sh/upd | 9 | 
1 files changed, 8 insertions, 1 deletions
| @@ -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  } | 
