installs mysql components

These are needed for the stats database and scripts.
This commit is contained in:
jacobsalmela 2016-01-20 19:46:44 -06:00
parent 739027a27d
commit ec9999fa6b

View file

@ -141,22 +141,22 @@ do
IPv4)useIPv4=true;; IPv4)useIPv4=true;;
IPv6)useIPv6=true;; IPv6)useIPv6=true;;
esac esac
done done
if [ $useIPv4 ] && [ ! $useIPv6 ]; then if [ $useIPv4 ] && [ ! $useIPv6 ]; then
getStaticIPv4Settings getStaticIPv4Settings
setStaticIPv4 setStaticIPv4
echo "::: Using IPv4 on $IPv4addr" echo "::: Using IPv4 on $IPv4addr"
echo "::: IPv6 will NOT be used." echo "::: IPv6 will NOT be used."
fi fi
if [ ! $useIPv4 ] && [ $useIPv6 ]; then if [ ! $useIPv4 ] && [ $useIPv6 ]; then
useIPv6dialog useIPv6dialog
echo "::: IPv4 will NOT be used." echo "::: IPv4 will NOT be used."
echo "::: Using IPv6 on $piholeIPv6" echo "::: Using IPv6 on $piholeIPv6"
fi fi
if [ $useIPv4 ] && [ $useIPv6 ]; then if [ $useIPv4 ] && [ $useIPv6 ]; then
getStaticIPv4Settings getStaticIPv4Settings
setStaticIPv4 setStaticIPv4
useIPv6dialog useIPv6dialog
echo "::: Using IPv4 on $IPv4addr" echo "::: Using IPv4 on $IPv4addr"
echo "::: Using IPv6 on $piholeIPv6" echo "::: Using IPv6 on $piholeIPv6"
fi fi
@ -165,7 +165,7 @@ done
echo "::: Exiting" echo "::: Exiting"
exit 1 exit 1
fi fi
} }
useIPv6dialog() useIPv6dialog()
@ -300,8 +300,15 @@ $SUDO echo "::: ...done."
$SUDO echo "::: Installing dnsmasq..." $SUDO echo "::: Installing dnsmasq..."
$SUDO apt-get -yqq install dnsmasq & spinner $! $SUDO apt-get -yqq install dnsmasq & spinner $!
$SUDO echo "::: ...done." $SUDO echo "::: ...done."
$SUDO echo "::: Installing lighttpd, php5-common, php5-cgi, and php5..." $SUDO echo "::: Installing lighttpd, php5-common, php5-cgi, php5, and php5-mysql..."
$SUDO apt-get -yqq install lighttpd php5-common php5-cgi php5 & spinner $! $SUDO apt-get -yqq install lighttpd php5-common php5-cgi php5 php5-mysql & spinner $!
$SUDO echo "::: ...done."
$SUDO echo "::: Installing mysql-server..."
# Lets mysql-server be isntalled without prompting for a password creation
# Must be run before mysql-server is installed
echo mysql-server mysql-server/root_password password raspberry | sudo debconf-set-selections
echo mysql-server mysql-server/root_password_again password raspberry | sudo debconf-set-selections
$SUDO apt-get -yqq mysql-server & spinner $!
$SUDO echo "::: ...done." $SUDO echo "::: ...done."
$SUDO echo "::: Installing git..." $SUDO echo "::: Installing git..."
$SUDO apt-get -yqq install git & spinner $! $SUDO apt-get -yqq install git & spinner $!
@ -311,7 +318,7 @@ $SUDO echo "::: ...done."
installWebAdmin(){ installWebAdmin(){
$SUDO echo " " $SUDO echo " "
$SUDO echo "::: Downloading and installing latest WebAdmin files..." $SUDO echo "::: Downloading and installing latest WebAdmin files..."
if [ -d "/var/www/html/admin" ]; then if [ -d "/var/www/html/admin" ]; then
$SUDO rm -rf /var/www/html/admin $SUDO rm -rf /var/www/html/admin
fi fi
if [ -d "/var/www/html/AdminLTE-master" ]; then if [ -d "/var/www/html/AdminLTE-master" ]; then
@ -327,7 +334,7 @@ $SUDO echo "::: Creating log file and changing owner to dnsmasq..."
if [ ! -f /var/log/pihole.log ]; then if [ ! -f /var/log/pihole.log ]; then
$SUDO touch /var/log/pihole.log $SUDO touch /var/log/pihole.log
$SUDO chmod 644 /var/log/pihole.log $SUDO chmod 644 /var/log/pihole.log
$SUDO chown dnsmasq:root /var/log/pihole.log $SUDO chown dnsmasq:root /var/log/pihole.log
else else
$SUDO echo "::: No need to create, already exists!" $SUDO echo "::: No need to create, already exists!"
fi fi
@ -338,12 +345,12 @@ $SUDO echo "::: ...done."
installPiholeWeb(){ installPiholeWeb(){
$SUDO echo " " $SUDO echo " "
$SUDO echo "::: Downloading and installing pihole custom index page..." $SUDO echo "::: Downloading and installing pihole custom index page..."
if [ -d "/var/www/html/pihole" ]; then if [ -d "/var/www/html/pihole" ]; then
$SUDO echo "::: Existing page detected, not overwriting" $SUDO echo "::: Existing page detected, not overwriting"
else else
$SUDO mkdir /var/www/html/pihole $SUDO mkdir /var/www/html/pihole
$SUDO mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig $SUDO mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig
$SUDO curl -o /var/www/html/pihole/index.html https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html $SUDO curl -o /var/www/html/pihole/index.html https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html
fi fi
$SUDO echo "::: ...done." $SUDO echo "::: ...done."
} }
@ -420,4 +427,4 @@ $SUDO mv $tmpLog $instalLogLoc
displayFinalMessage displayFinalMessage
$SUDO service dnsmasq start $SUDO service dnsmasq start
$SUDO service lighttpd start $SUDO service lighttpd start