Skip to content

Commit

Permalink
feat/baremetal (#18)
Browse files Browse the repository at this point in the history
* feat(): script is runnable on baremetal

* feat(): check if .env is used with docker or not

* doc(): add baremetal to README
  • Loading branch information
ArmanTaheriGhaleTaki authored May 12, 2024
1 parent a582a20 commit e4bb0a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ I had so many challenges in choosing the best DNS sni proxy server that fits my

## Getting Started

You can use this script with **docker**
You can use this script with **docker** or run in **baremetal**

## Baremetal
Also you can run this script on **baremetal** with **sudo** privilege
```sh
wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/main/bash.sh && sudo bash bash.sh
```

## Docker

Expand All @@ -27,8 +33,6 @@ or you can use built image uploaded in dockerhub
wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/main/.env && docker run --env-file .env armantaherighaletaki/best403unlocker
```

<!-- CONTACT -->

## Contact

My social media - [@armondy🙄](https://twitter.com/taherighaletaki) - [email protected]
Expand Down
11 changes: 11 additions & 0 deletions bash.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Functions
check_and_source_env() {
if [ -z "$dns" ]; then
if [ ! -f ./.env ]; then
wget -c https://raw.githubusercontent.com/ArmanTaheriGhaleTaki/best403unlocker/main/.env
fi
source .env
fi
}

function change_dns () {

echo 'nameserver' $1> /etc/resolv.conf
Expand All @@ -22,6 +31,7 @@ rm /tmp/$1


# Execute the functions
check_and_source_env
touch database
cp /etc/resolv.conf /etc/resolv.conf.bakup
for i in $dns
Expand All @@ -35,3 +45,4 @@ echo best dns server is `sort -rn database| head -1| cut -d'/' -f3 | tee -a outp
echo '*********************'
rm database
cat /etc/resolv.conf.bakup > /etc/resolv.conf

0 comments on commit e4bb0a6

Please sign in to comment.