diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-10-25 17:45:44 +0000 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-10-25 17:45:44 +0000 |
commit | 7f6d9e86bfd729267842e54f668b3bf241092837 (patch) | |
tree | 100bc184a364d4a949298f3bb7bdbd21ecdb5cb5 | |
parent | 69cdea343bd48743ee91352659a69abafcbf9583 (diff) | |
parent | e5b1cc98c32058e66cf98b4c4ec625ecd4705925 (diff) |
Merge branch 'bugfix/23/fix-check-vpn-command' into 'master'
Changed messaging and check-vpn commands to use api.ipify.org
Closes #23
See merge request rogs/yams!12
-rwxr-xr-x | yams | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -53,21 +53,26 @@ if [ "$option" == "start" ]; then fi if [ "$option" == "check-vpn" ]; then - echo "Getting your qBittorrent IP..." - qbittorrent_ip=$(docker exec qbittorrent sh -c "curl -s ifconfig.me"); - echo "$qbittorrent_ip" - echo "Your country in qBittorrent is $($dc exec -it qbittorrent sh -c 'curl -s https://am.i.mullvad.net/country')" - echo echo "Getting your IP..." - your_ip=$(curl -s ifconfig.me) + your_ip=$(curl -s api.ipify.org) echo "$your_ip" echo "Your local IP country is $(curl -s https://am.i.mullvad.net/country)" echo - if [ "$qbittorrent_ip" == "$your_ip" ]; then - send_error_message "Your IPs are the same! qBittorrent is NOT working! ⚠️" - else - send_success_message "Your IPs are different. qBittorrent is working as expected! ✅ " - fi + echo + echo "Getting your qBittorrent IP..." + + qbittorrent_ip=$(docker exec qbittorrent sh -c "curl -s api.ipify.org"); + if [ -n "$qbittorrent_ip" ]; then + echo "$qbittorrent_ip" + echo "Your country in qBittorrent is $(docker exec -it qbittorrent sh -c 'curl -s https://am.i.mullvad.net/country')" + if [ "$qbittorrent_ip" == "$your_ip" ]; then + send_error_message "Your IPs are the same! qBittorrent is exposing your IP! ⚠️" + else + send_success_message "Your IPs are different. qBittorrent is masking your IP! ✅ " + fi + else + send_error_message "Failed to retrieve qBittorrent IP. Please check your setup. ⚠️" + fi fi if [ "$option" == "destroy" ]; then |