diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2024-06-30 14:19:42 -0700 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2024-06-30 14:19:42 -0700 |
commit | e9a3936e5a91aa2ee75526f5711248f731032266 (patch) | |
tree | c73819c133f74fc14584c9aabbb92637ec377440 | |
parent | 5eed9e833242ef8ca9f410d5c7b566267b74825f (diff) |
vpn add prompt
-rwxr-xr-x | sh/vpn | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -19,14 +19,14 @@ if nmcli -t --fields device,state device | grep -q "^wg_$1:connected$"; then if [ "$1" = aa ]; then # 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 - /usr/bin/alacritty -T aa --hold -e ssh -t aa.flylightning.xyz 'sudo systemctl stop wg-quick@wg0 && sudo systemctl start wg-quick@wg_ca' + /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"' fi down_not_mydefault nmcli connection up wg_mydefault notify-send -u critical "$1 VPN disabled" else if [ "$1" = aa ]; then - /usr/bin/alacritty -T aa --hold -e 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 aa.flylightning.xyz "sudo systemctl stop wg-quick@wg_ca && sudo systemctl start wg-quick@wg0"' fi down_not_mydefault nmcli connection down wg_mydefault |