summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh')
-rwxr-xr-xsh/upd14
-rwxr-xr-xsh/vpn4
2 files changed, 9 insertions, 9 deletions
diff --git a/sh/upd b/sh/upd
index 89113de..6485750 100755
--- a/sh/upd
+++ b/sh/upd
@@ -248,7 +248,7 @@ music () {
monthly_misc () {
if [ "$hostname" = xyzinsp ]; then
- if scp ca:/etc/pacman.d/mirrorlist aa:/tmp; then
+ if scp ca:/etc/pacman.d/mirrorlist aawg:/tmp; then
echo 'Wait for aa 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
@@ -259,14 +259,14 @@ 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' &
- 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.4 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" &
+ curl -sS -X POST 'iawg:57151/api/v2/search/updatePlugins' &
+ curl -sS -X POST 'ibwg:57151/api/v2/search/updatePlugins' &
+ for qbt_wireguard_host in stwg iawg ibwg; 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_host: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
+ curl -sS "$qbt_wireguard_host: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
# need POST to delete torrents. -d default POST, so no need `-X POST`
- curl -sS -d "hashes=$hash" -d deleteFiles=true "$qbt_wireguard_ip:57151/api/v2/torrents/delete"
+ curl -sS -d "hashes=$hash" -d deleteFiles=true "$qbt_wireguard_host:57151/api/v2/torrents/delete"
done &
done
wait
diff --git a/sh/vpn b/sh/vpn
index aed5410..bdda294 100755
--- a/sh/vpn
+++ b/sh/vpn
@@ -13,7 +13,7 @@ wg_aa_restore_default () {
case "$(nmcli -t --fields device,state device)" in
# stop aa wireguard+swgp server that listen from insp wiregurad+swgp client, start aa wg+swgp connect to ca
# use /usr/bin/alacritty instead of /home/xyz/.local/bin/alacritty so script can wait until alacritty exit to run other codes following
- *wg_aa:connected*) /usr/bin/alacritty -T aa --hold -e sh -c 'echo "Wait for aa sudo prompt and enter password, then manully close this window:"; ssh -t aa.flylightning.xyz "sudo systemctl stop wg-quick@wg0 && sudo systemctl start wg-quick@wg_ca"';;
+ *wg_aa:connected*) /usr/bin/alacritty -T aa --hold -e sh -c 'echo "Wait for aa sudo prompt and enter password, then manully close this window:"; ssh -t aawg "sudo systemctl stop wg-quick@wg0 && sudo systemctl start wg-quick@wg_ca"';;
esac
}
@@ -33,7 +33,7 @@ if nmcli -t --fields device,state device | grep -q "^wg_$1:connected$"; then
notify-send -u critical "$1 VPN disabled"
else
if [ "$1" = aa ]; then
- /usr/bin/alacritty -T aa --hold -e sh -c 'echo "Wait for aa sudo prompt and enter password, then manully close this window"; ssh -t aa.flylightning.xyz "sudo systemctl stop wg-quick@wg_ca && sudo systemctl start wg-quick@wg0"'
+ /usr/bin/alacritty -T aa --hold -e sh -c 'echo "Wait for aa sudo prompt and enter password, then manully close this window"; ssh -t aawg "sudo systemctl stop wg-quick@wg_ca && sudo systemctl start wg-quick@wg0"'
fi
down_not_mydefault
nmcli connection down wg_mydefault