diff --git a/unbound/install.sh b/unbound/install.sh index 95d8118..1de2ca0 100644 --- a/unbound/install.sh +++ b/unbound/install.sh @@ -5,28 +5,34 @@ GREEN='\033[0;32m' NC='\033[0m' # No Color # Get the local IP +echo -e "${GREEN}Getting local IP...${NC}" + LOCAL_IP=$(hostname -I | awk '{print $1}') # Get the subnet +echo -e "${GREEN}Getting subnet...${NC}" + SUBNET=$(ip -o -f inet addr show | awk '/scope global/ {split($4, a, "."); print a[1] "." a[2] "." a[3] ".0"}') echo -e "${GREEN}Updating package index...${NC}" sudo apt update +# Install unbound echo -e "\n${GREEN}Installing unbound...${NC}" + sudo apt install unbound -y +# Check if unbound is enabled echo -e "\n${GREEN}Checking if unbound is enabled to start on boot...${NC}" sudo systemctl is-enabled unbound +# Check if unbound is running echo -e "\n${GREEN}Checking the status of unbound...${NC}" sudo systemctl status unbound +# Add configurations to unbound.conf.d/main.conf echo -e "\n${GREEN}Adding configurations to unbound.conf.d/main.conf...${NC}" -# Header comment -echo "# Adding DNS-Over-TLS support" | sudo tee -a /etc/unbound/unbound.conf.d/main.conf - # Begin server configuration block echo "server:" | sudo tee -a /etc/unbound/unbound.conf.d/main.conf @@ -76,6 +82,8 @@ echo " access-control: 127.0.0.0/8 allow # Allow entire localhost subnet" | echo " access-control: $SUBNET/24 allow # Allow current local subnet" | sudo tee -a /etc/unbound/unbound.conf.d/main.conf # Logging configurations +echo -e "\n${GREEN}Configuring rsyslog...${NC}" + cat <