Commit deef9066 authored by Eduard Toloza's avatar Eduard Toloza

Fixed PATH issues

parent 800c9341
......@@ -3,22 +3,22 @@
# Autor: Edu4rdSHL @edu4rdshl
#Defining variables
istor="/usr/bin/tor"
istor=$(which tor > /dev/null)
torconfig="/etc/tor/torrc"
torconfigbackup="/etc/tor/torrc.backup"
issystemd="/usr/bin/systemctl"
issystemd=$(which systemctl > /dev/null)
executablerules="./files/tor-router"
servicefile="./files/tor-router.service"
iscurl="/usr/bin/curl"
iscurl=$(which curl > /dev/null)
#Check if the current user have root privileges
if [ "$UID" -ne "0" ] ; then
echo -e "\nYou need root permisions to run it script."
exit
echo -e "\nYou need root permisions to run it script."
exit
fi
echo -e "Checking if TOR and Systemd are installed..."
if [ -f "$istor" ] && [ -f "$torconfig" ] && [ -f "$issystemd" ] ; then
if [ -x "$istor" ] && [ -f "$torconfig" ] && [ -x "$issystemd" ] ; then
echo -e "\nAll fundamentals tools are installed, proceding..."
echo -e "\nPLEASE, RUN IT SCRIPT ONLY A TIME, IF YOU RUN IT TWO OR MORE TIMES WILL CAUSE ISSUES WITH YOUR $torconfig FILE!"
echo -e "\nMaking a backup of your torrc file, if you have problems with the new configuration, delete $torconfig and move $torconfigbackup to $torconfig"
......@@ -34,7 +34,7 @@ if [ -f "$istor" ] && [ -f "$torconfig" ] && [ -f "$issystemd" ] ; then
systemctl enable tor && systemctl restart tor
if [ "$?" == 0 ] ; then
echo -e "Checking if all are working..."
if [ -f "$iscurl" ] ; then
if [ -x "$iscurl" ] ; then
curl https://check.torproject.org/ | grep "Congratulations."
if [ "$?" == 0 ] ; then
echo -e "\nAll is OK, from now on all your network traffic is under the TOR Network, look for your IP addres in your browser."
......@@ -44,7 +44,7 @@ if [ -f "$istor" ] && [ -f "$torconfig" ] && [ -f "$issystemd" ] ; then
echo -e "\nYou haven't curl installed, try opening https://check.torproject.org/ in your browser and look for 'Congratulations.'"
fi
else
echo -e "\nAn error as ocurrer, please open a issue in https://github.com/Edu4rdSHL/tor-router/issues including log info and your Linux distribution."
echo -e "\nAn error as ocurrer, please open a issue in https://gitlab.com/Edu4rdSHL/tor-router/issues including log info and your Linux distribution."
fi
else
echo -e "Systemd or TOR are not installed, the script dont work."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment