From e6ae5d3b3bbcd0f2f2af7536eba849b2f094b4ee Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sun, 15 Jan 2023 19:47:05 -0300 Subject: Added command to check the VPN in yams cli --- yams | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/yams b/yams index 043aa78..f6cad96 100755 --- a/yams +++ b/yams @@ -2,7 +2,6 @@ set -eo pipefail dc="docker-compose -f " -install_location="" option=${1:-"--help"} @@ -16,6 +15,7 @@ help() { echo "stop stops all yams services" echo "start starts yams services" echo "destroy destroy yams services so you can start from scratch" + echo "check-vpn checks if the VPN is working as expected" } if [ $option == "--help" ]; then @@ -40,6 +40,24 @@ if [ $option == "start" ]; then exit 0 fi +if [ $option == "check-vpn" ]; then + echo "Getting your qBittorrent IP..." + qbittorrent_ip=$($dc exec -it qbittorrent sh -c "curl -s ifconfig.me"); + echo "$qbittorrent_ip" + echo + echo "Getting your IP..." + your_ip=$(curl -s ifconfig.me) + echo "$your_ip" + echo + if [ $qbittorrent_ip == $your_ip ]; then + echo "Your IPs are the same! qBittorrent is NOT working!" + exit 255 + else + echo "Your IPs are different. qBittorrent is working as expected!" + exit 0 + fi +fi + if [ $option == "destroy" ]; then echo echo -- cgit v1.2.3