diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/Dockerfile b/Dockerfile index e5de65b..b546faf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ RUN apt-get update && \ # Copy the script to the container COPY getToken.sh /opt/getToken.sh -#COPY addToWhiteList.sh /opt/curl_script.sh -COPY deleteFromWhiteList.sh /opt/curl_script.sh +COPY addToWhiteList.sh /opt/curl_script.sh +#COPY deleteFromWhiteList.sh /opt/curl_script.sh # Set the script as executable RUN chmod +x /opt/getToken.sh diff --git a/README.md b/README.md index 943836c..0bccbe6 100644 --- a/README.md +++ b/README.md @@ -4,30 +4,33 @@ This is a work in progress. - ## Requirements - - Docker (optional) - - Linux Shell - - Curl +## Requirements + - Docker (optional) + - Linux Shell + - Curl - ## Usage +## Usage - ### Docker - 1. Build the image +### Docker + 1. Build the image ```bash - docker build -t deeper-network-auto-requester . + docker build -t deeper-network-auto-requester . ``` - 2. Run the image + 2. Run the image + ```bash - docker run --rm deeper-network-auto-requester + docker run --rm deeper-network-auto-requester ``` It only adds, for the moment. If you wish to delete using docker image just edit the dockerfile and switch the comment between lines 9 and 10. And off course build the image again. To remove the country code is not used. ### Shell Add to the White List + ```bash ./opt/addToWhiteList.sh ``` Remove from the White List + ```bash ./opt/deleteFromWhiteList.sh ``` diff --git a/deleteFromWhiteList.sh b/deleteFromWhiteList.sh index 36fd38e..5289ad5 100644 --- a/deleteFromWhiteList.sh +++ b/deleteFromWhiteList.sh @@ -1,16 +1,15 @@ #!/bin/bash # Check if all three arguments are provided -if [ $# -ne 4 ]; then - echo "Usage: $0 " +if [ $# -ne 3 ]; then + echo "Usage: $0 " exit 1 fi # Parse the IP range, country code, and bearer token from arguments ip_range=$1 -country_code=$2 -username=$3 -password=$4 +username=$2 +password=$3 # Function to convert IP address to integer ip_to_int() {