summaryrefslogtreecommitdiff
path: root/sh/upd
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2024-12-29 02:30:46 -0800
committerXiao Pan <xyz@flylightning.xyz>2024-12-29 02:30:46 -0800
commit40212b1c2bddb55d041a7ea4b463185ae9bc8f54 (patch)
treef56cf56244d6ce5ef75559d86ab8bad88f2d6c59 /sh/upd
parent898f9b87858bf54d49c0ef6db57341b9ae90bb28 (diff)
consider new ib server
Diffstat (limited to 'sh/upd')
-rwxr-xr-xsh/upd10
1 files changed, 5 insertions, 5 deletions
diff --git a/sh/upd b/sh/upd
index f8a315d..92856b9 100755
--- a/sh/upd
+++ b/sh/upd
@@ -9,7 +9,7 @@ all () {
# pp maybe finish upd -a first and start to suspend, and it cause insp music() failed to rsync to pp, so I need to finish rsync to ssh before pp finish upd, so I put music() here, not perfect but good enough
[ "$hostname" = xyzinsp ] && music
# monthly_misc() needs to use qbittorrent-nox APIs, so I need to restart qbt before that, so I put qb() at top here, not perfect but good enough
- if [ "$hostname" = xyzia ]; then
+ if [ "$hostname" = xyzia ] || [ "$hostname" = xyzib ]; then
qb
fi
fast
@@ -84,7 +84,7 @@ backup () {
# --files-from has a bug, this bug makes source url that is / not working while /home works, more see vq notes
# --use-agent not working when ssh to pp and insp, works on insp, not sure why
# --use-agent maybe timeout on gpg key and failed when do full backup, maybe due to key stored in gpg agent timeout, so I'm not using --use-agent on insp now
- sudo duplicity --ssh-askpass --encrypt-key 9790577D2BE328D46838117ED3F54FE03F3C68D6 --sign-key 05899270DF25BB1EEDF57BE824F769E5D08C9E9A --full-if-older-than 2Y --include /etc/.cfgs --include-filelist "/home/xyz/.config/myconf/upd_rsync_files" --exclude / / "sftp://xyz@ia.flylightning.xyz//home/xyz/backup/$backup_branch"
+ sudo duplicity --ssh-askpass --encrypt-key 9790577D2BE328D46838117ED3F54FE03F3C68D6 --sign-key 05899270DF25BB1EEDF57BE824F769E5D08C9E9A --full-if-older-than 2Y --include /etc/.cfgs --include-filelist "/home/xyz/.config/myconf/upd_rsync_files" --exclude / / "sftp://xyz@ib.flylightning.xyz//home/xyz/backup/$backup_branch"
fi
}
@@ -231,7 +231,7 @@ refl () {
# https://www.reddit.com/r/archlinux/comments/mynw6e/rsync_mirrors_with_pacman/
# need --delay so no super out of sync mirrors
case "$hostname" in
- xyzia) sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country ro --protocol https --delay 1 --fastest 3;;
+ xyzia|xyzib) sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country ro --protocol https --delay 1 --fastest 3;;
# aa now default wireguard to ca, so I choose to copy ca mirrorlist to aa instead
# old cn mirrorlists code, only 2 cn mirror servers satisfied `--delay 1`, https://mirrors.jlu.edu.cn/archlinux/$repo/os/$arch is better than https://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch , the latter had issues
#xyzaa) sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country cn --protocol https --delay 1 --fastest 2;;
@@ -258,8 +258,8 @@ monthly_misc () {
fi
# https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)
- curl -sS -X POST '10.0.0.4:57151/api/v2/search/updatePlugins' &
- for qbt_wireguard_ip in 10.0.0.3 10.0.0.4; do
+ curl -sS -X POST '10.0.0.8:57151/api/v2/search/updatePlugins' &
+ for qbt_wireguard_ip in 10.0.0.3 10.0.0.8; do
curl -sS https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt | awk '$0{printf("%s\\n",$0)}' | xargs -0 -I {} curl -sS -d json='{"add_trackers":"{}"}' "$qbt_wireguard_ip:57151/api/v2/app/setPreferences" &
# another way: `jq -r '.[]|"\(.added_on)\t\(.hash)\t\(.name)"'`
curl -sS "$qbt_wireguard_ip:57151/api/v2/torrents/info?category=useful" | jq -r '.[]|[.added_on,.hash,.name]|@tsv' | grep 'archlinux.*\.iso' | sort -n | head -n-1 | awk '{print $2}' | while read -r hash; do