pi-hole/automated install/basic-install.sh

68 lines
2.3 KiB
Bash
Raw Normal View History

2014-12-20 18:43:10 +00:00
#!/bin/bash
# Pi-hole automated install
# Raspberry Pi Ad-blocker
#
# Install with this command (from the Pi):
#
2014-12-20 19:10:58 +00:00
# curl -s "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/automated%20install/basic-install.sh" | bash
2014-12-20 18:43:10 +00:00
#
# Or run the commands below in order
clear
echo " _____ _ _ _ "
echo " | __ (_) | | | | "
echo " | |__) | __ | |__ ___ | | ___ "
2014-12-20 18:44:36 +00:00
echo " | ___/ | |__| | '_ \ / _ \| |/ _ \ "
echo " | | | | | | | | (_) | | __/ "
echo " |_| |_| |_| |_|\___/|_|\___| "
2014-12-20 18:43:10 +00:00
echo " "
echo " Raspberry Pi Ad-blocker "
echo " "
echo " Automated install "
echo " --Advanced-- "
2014-12-20 18:43:10 +00:00
echo " "
echo " "
2014-12-20 19:10:58 +00:00
sleep 2
2014-12-20 18:43:10 +00:00
echo "Updating the Pi..."
2014-12-20 18:43:10 +00:00
sudo apt-get update
sudo apt-get -y upgrade
echo "Installing DNS..."
2014-12-20 18:43:10 +00:00
sudo apt-get -y install dnsutils dnsmasq
echo "Installing a Web server"
2014-12-20 18:43:10 +00:00
sudo apt-get -y install lighttpd
sudo chown www-data:www-data /var/www
sudo chmod 775 /var/www
sudo usermod -a -G www-data pi
echo "Stopping services to modify them..."
sudo service dnsmasq stop
2014-12-20 18:43:10 +00:00
sudo service lighttpd stop
echo "Backing up original config files and downloading Pi-hole ones..."
2014-12-20 19:10:58 +00:00
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
2014-12-20 18:43:10 +00:00
sudo mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig
sudo mv /var/www/index.lighttpd.html /var/www/index.lighttpd.orig
2014-12-20 19:10:58 +00:00
sudo curl -o /etc/dnsmasq.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/dnsmasq.conf"
2014-12-20 18:43:10 +00:00
sudo curl -o /etc/lighttpd/lighttpd.conf "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/lighttpd.conf"
sudo mkdir /var/www/pihole
sudo curl -o /var/www/pihole/index.html "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/index.html"
2015-03-23 15:46:54 +00:00
sudo curl -o /var/www/Transparent.gif "http://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif"
2014-12-20 18:43:10 +00:00
echo "Turning services back on..."
sudo service dnsmasq start
sudo service lighttpd start
echo "Locating the Pi-hole..."
sudo curl -o /usr/local/bin/gravity.sh "https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/gravity-adv.sh"
2014-12-20 18:43:10 +00:00
sudo chmod 755 /usr/local/bin/gravity.sh
echo "Entering the event horizon..."
2014-12-20 18:43:10 +00:00
sudo /usr/local/bin/gravity.sh
echo "Restarting services..."
sudo service dnsmasq restart
sudo service lighttpd restart