summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-01-15 19:47:05 -0300
committerRoger Gonzalez <roger@rogs.me>2023-01-15 19:47:05 -0300
commite6ae5d3b3bbcd0f2f2af7536eba849b2f094b4ee (patch)
tree1216452d9499693280e1c415009fab4c478a526c
parentfeda1f4a10beff7a687c127a5b117f818b5acec3 (diff)
Added command to check the VPN in yams cli
-rwxr-xr-xyams20
1 files changed, 19 insertions, 1 deletions
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 <filename>"
-install_location="<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