diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-10-26 17:06:35 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-10-26 17:06:35 -0300 |
commit | 6d01b1f141e2d4825c70e4d2ed1fb6644b6af9a9 (patch) | |
tree | dfc1ce3caf9b1f9e62bc7895dcc51667b4158c31 | |
parent | e4f20e9ebe0314b8cb54bc18cd4fc57e3e992132 (diff) | |
parent | 63bff4b94b086d77e26ebfb97e2a74085e593b14 (diff) |
-rw-r--r-- | README.org | 2 | ||||
-rw-r--r-- | docs.org | 4 | ||||
-rw-r--r-- | install.sh | 4 | ||||
-rwxr-xr-x | yams | 27 |
4 files changed, 25 insertions, 12 deletions
@@ -84,7 +84,7 @@ Before installing, make sure you have: #+begin_src bash $ git clone https://gitlab.com/rogs/yams.git $ cd yams -$ ./install.sh +$ bash install.sh #+end_src And follow the instructions. @@ -201,6 +201,10 @@ if [ ! -d "$install_directory" ]; then fi fi +if [ ! -w "$install_directory" ] || [ ! -r "$install_directory" ]; then + send_error_message "The directory \"$install_directory\" is not writable or readable by the current user. Set the correct permissions or try a different directory" ❌ +fi + filename="$install_directory/docker-compose.yaml" custom_file_filename="$install_directory/docker-compose.custom.yaml" env_file="$install_directory/.env" @@ -95,6 +95,10 @@ if [ ! -d "$install_directory" ]; then fi fi +if [ ! -w "$install_directory" ] || [ ! -r "$install_directory" ]; then + send_error_message "The directory \"$install_directory\" is not writable or readable by the current user. Set the correct permissions or try a different directory" ❌ +fi + filename="$install_directory/docker-compose.yaml" custom_file_filename="$install_directory/docker-compose.custom.yaml" env_file="$install_directory/.env" @@ -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 |