Skip to content

Commit

Permalink
chore(): change .env to best403unlocker.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmanTaheriGhaleTaki committed Jul 1, 2024
1 parent 0044caa commit d420dec
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
you can add new DNS servers in [.env](https://github.com/ArmanTaheriGhaleTaki/speed-test-dns/blob/main/.env) with the following format
you can add new DNS servers in [best403unlocker.conf](https://github.com/ArmanTaheriGhaleTaki/speed-test-dns/blob/main/best403unlocker.conf) with the following format
```
#########################
#https://example.com/
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/m

## Docker

You only need **docker** installed and you can edit variables in [.env](https://github.com/ArmanTaheriGhaleTaki/best403unlocker/blob/main/.env) for your needs.
You only need **docker** installed and you can edit variables in [best403unlocker.conf](https://github.com/ArmanTaheriGhaleTaki/best403unlocker/blob/main/best403unlocker.conf) for your needs.

```sh
git clone --depth 1 https://github.com/ArmanTaheriGhaleTaki/best403unlocker/ && cd best403unlocker && docker build -t best403unlocker . && docker run --env-file .env best403unlocker
git clone --depth 1 https://github.com/ArmanTaheriGhaleTaki/best403unlocker/ && cd best403unlocker && docker build -t best403unlocker . && docker run --env-file best403unlocker.conf best403unlocker
```

or you can use built image uploaded in dockerhub
_for that case you need to use [.env](https://github.com/ArmanTaheriGhaleTaki/best403unlocker/blob/main/.env) at run time_
_for that case you need to use [best403unlocker.conf](https://github.com/ArmanTaheriGhaleTaki/best403unlocker/blob/main/best403unlocker.conf) at run time_

```sh
wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/main/.env && docker run --env-file .env armantaherighaletaki/best403unlocker
wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/main/best403unlocker.conf && docker run --env-file best403unlocker.conf armantaherighaletaki/best403unlocker
```


Expand Down
6 changes: 3 additions & 3 deletions bash.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Functions
check_and_source_env() {
if [ -z "$dns" ]; then
if [ ! -f ./.env ]; then
wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/main/.env
if [ ! -f ./best403unlocker.conf ]; then
wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/main/best403unlocker.conf
fi
source .env
source best403unlocker.conf
fi
}

Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions main.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
source .env
source best403unlocker.conf

# Function to display the main menu
main_menu() {
Expand Down Expand Up @@ -38,8 +38,8 @@ best_dns_finder() {

# Replace the value of file_url with the value of the file_url environment variable

if grep -q "^file_url=" ".env" ; then
sed -i "s|^file_url=.*|file_url=$file_url|" .env
if grep -q "^file_url=" "best403unlocker.conf" ; then
sed -i "s|^file_url=.*|file_url=$file_url|" best403unlocker.conf
fi

choices=$(whiptail --title "choose engine otherwise it runs on system" --checklist "Choose options:" 15 60 1 \
Expand All @@ -49,12 +49,12 @@ best_dns_finder() {
selected_options=($(echo $choices | tr -d '"'))
# Check if "docker" is in the selected options
if [[ " ${selected_options[@]} " =~ " docker " ]]; then
docker run --env-file .env armantaherighaletaki/best403unlocker 2>&1 | tee log.txt
docker run --env-file best403unlocker.conf armantaherighaletaki/best403unlocker 2>&1 | tee log.txt
status=$?

if [ $status -eq 0 ] && grep -q permission log.txt; then
password_checker
echo "$password" | sudo -S docker run --env-file .env armantaherighaletaki/best403unlocker | tee log.txt 2>&1
echo "$password" | sudo -S docker run --env-file best403unlocker.conf armantaherighaletaki/best403unlocker | tee log.txt 2>&1
elif [ $status -eq 0 ]; then
whiptail --title "Error" --yesno "An error occurred. See log.txt for more info.\nDo you want to try again?" 15 60
status=$?
Expand Down Expand Up @@ -90,8 +90,8 @@ download_file_with_best_dns() {

# Replace the value of file_url with the value of the file_url environment variable

if grep -q "^file_url=" ".env" ; then
sed -i "s|^file_url=.*|file_url=$file_url|" .env
if grep -q "^file_url=" "best403unlocker.conf" ; then
sed -i "s|^file_url=.*|file_url=$file_url|" best403unlocker.conf
fi
save_filepath=$(echo "$file_url" | grep -o '[^/]*$')
save_filepath=$HOME/Downloads/$save_filepath
Expand All @@ -108,12 +108,12 @@ download_file_with_best_dns() {
selected_options=($(echo $choices | tr -d '"'))
# Check if "docker" is in the selected options
if [[ " ${selected_options[@]} " =~ " docker " ]]; then
docker run --env-file .env armantaherighaletaki/best403unlocker 2>&1 | tee log.txt
docker run --env-file best403unlocker.conf armantaherighaletaki/best403unlocker 2>&1 | tee log.txt
status=$?

if [ $status -eq 0 ] && grep -q permission log.txt; then
password_checker
echo "$password" | sudo -S docker run --env-file .env armantaherighaletaki/best403unlocker | tee log.txt 2>&1
echo "$password" | sudo -S docker run --env-file best403unlocker.conf armantaherighaletaki/best403unlocker | tee log.txt 2>&1
fi

else
Expand Down

0 comments on commit d420dec

Please sign in to comment.