Added command to check the VPN in yams cli

This commit is contained in:
Roger Gonzalez 2023-01-15 19:47:05 -03:00
parent feda1f4a10
commit e6ae5d3b3b
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

20
yams
View File

@ -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