diff --git a/README.md b/README.md index a3ec897..6787874 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 My social media - [@armondy🙄](https://twitter.com/taherighaletaki) - armantahery1381@gmail.com diff --git a/bash.sh b/bash.sh index 110deb5..3ca3a7f 100644 --- a/bash.sh +++ b/bash.sh @@ -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 @@ -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 @@ -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 +