summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-04-21 22:13:17 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-04-21 22:13:17 -0700
commit0c40e003145789e027e69f51425ac4201f369d58 (patch)
treea5ed25d94d4105790269db8f45877ccf3b427d0f /sh
parent9e7482a1d28dd912847b8afc9a3cb71288bba8f7 (diff)
remove ka vps
Diffstat (limited to 'sh')
-rwxr-xr-xsh/sbar1
-rwxr-xr-xsh/u2
-rwxr-xr-xsh/upd23
-rwxr-xr-xsh/vip5
-rwxr-xr-xsh/vpn2
5 files changed, 13 insertions, 20 deletions
diff --git a/sh/sbar b/sh/sbar
index b12062b..9bdc8b8 100755
--- a/sh/sbar
+++ b/sh/sbar
@@ -17,7 +17,6 @@ update_net () {
net="$(if nmcli -t --fields type,state device | grep -q '^\(ethernet\|wifi\):connected$'; then echo 1; else echo 0; fi)"
case "$(nmcli -t --fields device,state device)" in
*wg_ia:connected*) wg=I;;
- *wg_ka:connected*) wg=K;;
*wg_mydefault:connected*) wg=D;;
*wg_studio:connected*) wg=S;;
*) wg=0;;
diff --git a/sh/u b/sh/u
index 68a8697..2e346dc 100755
--- a/sh/u
+++ b/sh/u
@@ -3,7 +3,7 @@
ssh-add -l || ssh-add
-for host in ca ka ia studio pp; do
+for host in ca ia studio pp; do
# alacritty use -T to change window name so I can identify different servers
# need to invoke bash afterwards for manual things like reboot if linux upgrades and pacdiff
# maybe can automate further so no need manual things
diff --git a/sh/upd b/sh/upd
index e3101c8..9ffa1b0 100755
--- a/sh/upd
+++ b/sh/upd
@@ -4,7 +4,7 @@ all () {
fast
clean
[ "$hostname" != xyzpp ] && refl
- if [ "$hostname" = xyzka ] || [ "$hostname" = xyzia ]; then
+ if [ "$hostname" = xyzia ]; then
qb
fi
[ "$hostname" = xyzinsp ] && music
@@ -20,16 +20,16 @@ backup () {
esac
if [ "$hostname" = xyzinsp ]; then
- # Pull repos and branches from studio, so one more backup on insp or duplicity will backup to ka,for one more backup for 321 backup rule
+ # Pull repos and branches from studio, so one more backup on insp or duplicity will backup to ia,for one more backup for 321 backup rule
# cfgl master and pp branches already satisfy 321 rule. Here are three copies: 1. master/pp, 2. studio, 3. gitlab or alternative
# But I still copy those on insp because one more copy will not hurt. And all my other data stil satisfy 3 copies without backup to gitlab, so why left out cfgl? Also it may be nice if I what to use that local dir for searching things.
cd "$HOME/programs/config_local_arch" || exit 1
git branch | awk '{print ($1=="*")?$2:$1}' | while read -r branch; do
git checkout "$branch"
git pull
- # Push ka and ia branch to codeberg or any future alternative website for mirroring. Needed for public codes/data, considering my death may result in all copies on my computers being lost.
+ # Push ca and ia branch to codeberg or any future alternative website for mirroring. Needed for public codes/data, considering my death may result in all copies on my computers being lost.
case "$branch" in
- ka|ia|ca) git push;;
+ ia|ca) git push;;
esac
done
# git checkout will change mtime, need to change back so rsync won't think it needs to backup these files
@@ -41,8 +41,6 @@ backup () {
(
umask 077
- # backup ka cfgs
- sudo -E git -C /root/programs/config_local_arch_secrets_ka pull
# backup studio cfgs, note: it backup a branch by clone/checkout to that branch first
sudo -E git -C /root/programs/config_local_arch_secrets pull
# backup ia cfgs
@@ -57,20 +55,18 @@ backup () {
fi
if [ "$hostname" = xyzinsp ] || [ "$hostname" = xyzstudio ]; then
- # rsync backup from ka
- rsync -avPR --delete ka:/home/xyz/.config/qBittorrent :/home/xyz/.local/share/qBittorrent/BT_backup "$HOME/backup/ka"
# rsync backup from ia
rsync -avPR --delete ia:/home/xyz/.config/qBittorrent :/home/xyz/.local/share/qBittorrent/BT_backup "$HOME/backup/ia"
fi
- if [ "$hostname" != xyzstudio ] && [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ] && [ "$hostname" != xyzca ]; then
+ if [ "$hostname" != xyzstudio ] && [ "$hostname" != xyzia ] && [ "$hostname" != xyzca ]; then
# rsync backup to studio
# --files-from make -a not imply -r, so need to specify explicitly
rsync -avPRr --delete --files-from="$XDG_CONFIG_HOME/myconf/upd_rsync_files" / "studio:/home/xyz/backup/$backup_branch"
fi
- if [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ] && [ "$hostname" != xyzca ]; then
- # duplicity backup to ka
+ if [ "$hostname" != xyzia ] && [ "$hostname" != xyzca ]; then
+ # duplicity backup to ia
# https://wiki.archlinux.org/title/Duplicity
# Need // for absolute path, see manpage URL FORMAT section. If not use //, will store to /home/xyz/home/xyz/...
# --files-from has a bug, this bug makes source url that is / not working while /home works, more see vq notes
@@ -78,7 +74,6 @@ backup () {
use_agent=
[ "$hostname" = xyzinsp ] && use_agent='--use-agent'
sudo duplicity --ssh-askpass $use_agent --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 $use_agent --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@xyzka.kyun.li//home/xyz/backup/$backup_branch"
fi
}
@@ -116,7 +111,7 @@ clean () {
fast () {
pac
misc
- if [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ] && [ "$hostname" != xyzca ]; then
+ if [ "$hostname" != xyzia ] && [ "$hostname" != xyzca ]; then
backup
fi
}
@@ -218,7 +213,7 @@ refl () {
# rsync may need to change XferCommand in /etc/pacman.conf
# https://www.reddit.com/r/archlinux/comments/mynw6e/rsync_mirrors_with_pacman/
# need --delay so no super out of sync mirrors
- if [ "$hostname" != xyzka ] && [ "$hostname" != xyzia ]; then
+ if [ "$hostname" != xyzia ]; then
sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country us --protocol https --delay 1 --latest 25 --score 25 --fastest 10
else
sudo reflector --verbose --save /etc/pacman.d/mirrorlist --country ro --protocol https --delay 1 --fastest 3
diff --git a/sh/vip b/sh/vip
index 0a0815f..0dd5963 100755
--- a/sh/vip
+++ b/sh/vip
@@ -3,7 +3,6 @@
case "$(nmcli -t --fields device,state device)" in
*wg_ia:connected*) echo ia;;
- *wg_ka:connected*) echo ka;;
*wg_mydefault:connected*) echo mydefault;;
*wg_studio:connected*) echo studio;;
*) echo none;;
@@ -14,8 +13,8 @@ printf '6: '; curl -6m1 ifconfig.co
# the old way, slower and more code
#nm_device_state="$(nmcli -t --fields device,state device)"
-#if echo "$nm_device_state" | grep -q '^wg_ka:connected$'; then
-# echo ka
+#if echo "$nm_device_state" | grep -q '^wg_ia:connected$'; then
+# echo ia
#elif echo "$nm_device_state" | grep -q '^wg_studio:connected$'; then
# echo studio
#else
diff --git a/sh/vpn b/sh/vpn
index dc855ed..b0f26a8 100755
--- a/sh/vpn
+++ b/sh/vpn
@@ -2,7 +2,7 @@
# toggle VPN
down_not_mydefault () {
- for v in wg_studio wg_ia wg_ka; do
+ for v in wg_studio wg_ia; do
nmcli connection down "$v"
done
}