echo -e "Got it! Next we're going to make sure the system's repositories (where they get their data from)\nare updated and that you have all the basic command line utilities we need to continue. \n\n${BLUE}(enter)${RESET}"
echo -e "Got it! Next we're going to make sure the system's repositories (where they get their data from)\nare updated and that you have all the basic command line utilities we need to continue. \n\n${BLUE}(enter)${RESET}"
read
read
install_if_needed(){# Coding Moment: generally, whenever you see something with brackets at the end of it, like this() or like(this), it's a function! It takes inputs and gives outputs
# Coding Moment: generally, whenever you see something with brackets at the end of it,
# like this() or like(this), it's a function! It takes inputs and gives outputs
# sudo sed -i "s#TORRCPATH#${TORRCPATH}#g" $TOR_SERVICE
sudo sed -i "s#TORRCPATH#${TORRCPATH}#g"$TOR_SERVICE
# sudo sed -i "s#TORPATH#$(which tor)#g" $TOR_SERVICE
sudo sed -i "s#TORPATH#$(which tor)#g"$TOR_SERVICE
#fi
fi
#
#
## Creating the .tor directory
# Creating the .tor directory
#sudo mkdir -p $HOME/.tor
sudo mkdir -p $HOME/.tor
#sudo chown tor $HOME/.tor
sudo chown tor $HOME/.tor
#sudo chgrp $USER $HOME/.tor
sudo chgrp $USER$HOME/.tor
#sudo chmod 770 $HOME/.tor
sudo chmod 770$HOME/.tor
#
#echo "Enabling and starting Tor"
echo "Enabling and starting Tor"
#sudo systemctl enable tor
sudo systemctl enable tor
#sudo systemctl start tor
sudo systemctl start tor
echo""
echo""
echo"Creating bitcoin.service..."
echo"Creating bitcoin.service..."
@ -511,40 +531,40 @@ sudo systemctl enable ao
sudo systemctl start ao
sudo systemctl start ao
echo""
echo""
echo"Enabling and starting ${GREEN}NGINX${RESET} as the webserver"
echo-e "Enabling and starting ${GREEN}NGINX${RESET} as the webserver"
sudo systemctl enable nginx
sudo systemctl enable nginx
sudo systemctl start nginx
sudo systemctl start nginx
# ------------------- Step 8 - Port Testing -------------------
# ------------------- Step 8 - Port Testing -------------------
#echo -e "${BOLD}One more thing!${RESET} We need to make sure that your ports are open."
echo""
#install_if_needed nmap
echo -e "${BOLD}One more thing!${RESET} We need to make sure that your ports are open."
#nmap -Pn $domain > nmap.txt
install_if_needed nmap
#OPEN=1
nmap -Pn $domain > nmap.txt
#if grep -qE "^80/.*(open|filtered)" nmap.txt; then
OPEN=1
# echo -e "I can see port ${GREEN}80${RESET}!"
if grep -qE "^80/.*(open|filtered)" nmap.txt;then
#else
echo -e "I can see port ${GREEN}80${RESET}!"
# echo -e "Uh oh, port ${RED}80${RESET} isn't showing up..."
else
# OPEN=0
echo -e "Uh oh, port ${RED}80${RESET} isn't showing up..."
#fi
OPEN=0
#
fi
#if grep -qE "^443/.*(open|filtered)" nmap.txt; then
# echo -e "I can see port ${GREEN}443${RESET} as well!"
if grep -qE "^443/.*(open|filtered)" nmap.txt;then
#else
echo -e "I can see port ${GREEN}443${RESET} as well!"
# echo -e "Uh oh, port ${RED}443${RESET} isn't showing up..."
else
# OPEN=0
echo -e "Uh oh, port ${RED}443${RESET} isn't showing up..."
#fi
OPEN=0
#rm nmap.txt
fi
#echo ""
rm nmap.txt
#if [[ $OPEN -eq 0 ]]; then
echo""
# echo -e "${RED}Port configuration needed.${RESET} Something (probably your wireless router) is blocking us from serving this page to the rest of the internet."
if[[$OPEN -eq 0]];then
# echo "Port forwarding is relatively simple, but as it stands it is beyond the scope of this script to be able to automate it."
echo -e "${RED}Port configuration needed.${RESET} Something (probably your wireless router) is blocking us from serving this page to the rest of the internet."
# echo -e "You'll probably need to look up the login information for your specific router and forward the red ports to the local IP of this computer (${BOLD}$(ip route | grep default | grep -oP "(?<=src )[^ ]+")${RESET})."
echo"Port forwarding is relatively simple, but as it stands it is beyond the scope of this script to be able to automate it."
# echo -e "You can log into your router at this IP address: ${BOLD}$(route -n | grep ^0.0.0.0 | awk '{print $2}')${RESET}"
echo -e "You'll probably need to look up the login information for your specific router and forward the red ports to the local IP of this computer (${BOLD}$(ip route | grep default | grep -oP "(?<=src )[^ ]+")${RESET})."
# echo "That's all the help I can give you regarding port forwarding. Good luck!"
echo -e "You can log into your router at this IP address: ${BOLD}$(route -n | grep ^0.0.0.0 | awk '{print $2}')${RESET}"
# echo ""
echo"That's all the help I can give you regarding port forwarding. Good luck!"
#fi
echo""
#
fi
# ------------------- Step 9 - Health Check -------------------
# ------------------- Step 9 - Health Check -------------------