From 69cdea343bd48743ee91352659a69abafcbf9583 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Wed, 25 Oct 2023 09:03:36 -0300 Subject: Replaced ./ with bash directly --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 9ec5814..a55c26e 100644 --- a/README.org +++ b/README.org @@ -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. -- cgit v1.2.3 From e5b1cc98c32058e66cf98b4c4ec625ecd4705925 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Wed, 25 Oct 2023 14:39:35 -0300 Subject: Changed messaging and check-vpn commands to use api.ipify.org --- yams | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/yams b/yams index db49e83..762313e 100755 --- a/yams +++ b/yams @@ -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 -- cgit v1.2.3 From 036f3fb1d1655197baf45a513e4c7ee882fac781 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Wed, 25 Oct 2023 23:06:22 -0300 Subject: Checking if the current user has enough permissions to install YAMS --- docs.org | 4 ++++ install.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs.org b/docs.org index 0109f71..ee85bf9 100644 --- a/docs.org +++ b/docs.org @@ -201,6 +201,10 @@ if [ ! -d "$install_directory" ]; then fi fi +if [ ! -w "$install_directory" ]; then + send_error_message "The directory \"$install_directory\" is not writtable 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" diff --git a/install.sh b/install.sh index 802a395..0eef3cd 100644 --- a/install.sh +++ b/install.sh @@ -95,6 +95,10 @@ if [ ! -d "$install_directory" ]; then fi fi +if [ ! -w "$install_directory" ]; then + send_error_message "The directory \"$install_directory\" is not writtable 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" -- cgit v1.2.3 From 63bff4b94b086d77e26ebfb97e2a74085e593b14 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Wed, 25 Oct 2023 23:15:40 -0300 Subject: Checking if the install directory is writtable and readable --- docs.org | 4 ++-- install.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs.org b/docs.org index ee85bf9..406c739 100644 --- a/docs.org +++ b/docs.org @@ -201,8 +201,8 @@ if [ ! -d "$install_directory" ]; then fi fi -if [ ! -w "$install_directory" ]; then - send_error_message "The directory \"$install_directory\" is not writtable by the current user. Set the correct permissions or try a different directory" ❌ +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" diff --git a/install.sh b/install.sh index 0eef3cd..8bf6514 100644 --- a/install.sh +++ b/install.sh @@ -95,8 +95,8 @@ if [ ! -d "$install_directory" ]; then fi fi -if [ ! -w "$install_directory" ]; then - send_error_message "The directory \"$install_directory\" is not writtable by the current user. Set the correct permissions or try a different directory" ❌ +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" -- cgit v1.2.3