1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 06:08:21 +00:00

Improve spinner function.

This commit is contained in:
Promofaux 2016-01-23 22:25:30 +00:00
parent e8b8fb0835
commit 206717828b

View File

@ -16,21 +16,6 @@
# #
# curl -L install.pi-hole.net | bash # curl -L install.pi-hole.net | bash
######## FIRST CHECK ########
# Must be root to install
if [[ $EUID -eq 0 ]];then
echo "You are root."
else
echo "::: sudo will be used for the install."
# Check if it is actually installed
# If it isn't, exit because the install cannot complete
if [[ $(dpkg-query -s sudo) ]];then
export SUDO="sudo"
else
echo "::: Please install sudo or run this as root."
exit 1
fi
fi
######## VARIABLES ######### ######## VARIABLES #########
tmpLog=/tmp/pihole-install.log tmpLog=/tmp/pihole-install.log
instalLogLoc=/etc/pihole/install.log instalLogLoc=/etc/pihole/install.log
@ -57,6 +42,29 @@ IPv4gw=$(ip route get 8.8.8.8 | awk '{print $3}')
availableInterfaces=$(ip -o link | awk '{print $2}' | grep -v "lo" | cut -d':' -f1) availableInterfaces=$(ip -o link | awk '{print $2}' | grep -v "lo" | cut -d':' -f1)
dhcpcdFile=/etc/dhcpcd.conf dhcpcdFile=/etc/dhcpcd.conf
######## FIRST CHECK ########
# Must be root to install
if [[ $EUID -eq 0 ]];then
echo "You are root."
else
echo "::: sudo will be used for the install."
# Check if it is actually installed
# If it isn't, exit because the install cannot complete
if [[ $(dpkg-query -s sudo) ]];then
export SUDO="sudo"
else
echo "::: Please install sudo or run this as root."
exit 1
fi
fi
if [ -f "/etc/dnsmasq.d/01-pihole.conf" ]; then
#Likely an existing install
upgrade=true
else
upgrade=false
fi
####### FUNCTIONS ########## ####### FUNCTIONS ##########
###All credit for the below function goes to http://fitnr.com/showing-a-bash-spinner.html ###All credit for the below function goes to http://fitnr.com/showing-a-bash-spinner.html
spinner(){ spinner(){
@ -129,7 +137,7 @@ chooseInterface(){
done done
} }
<<<<<<< HEAD
use4andor6(){ use4andor6(){
# Let use select IPv4 and/or IPv6 # Let use select IPv4 and/or IPv6
cmd=(whiptail --separate-output --checklist "Select Protocols" $r $c 2) cmd=(whiptail --separate-output --checklist "Select Protocols" $r $c 2)
@ -166,13 +174,6 @@ use4andor6(){
echo "::: Exiting" echo "::: Exiting"
exit 1 exit 1
fi fi
=======
useIPv6dialog()
{
piholeIPv6=$(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
whiptail --msgbox --backtitle "IPv6..." --title "IPv6 Supported" "$piholeIPv6 will be used to block ads." $r $c
$SUDO touch /etc/pihole/.useIPv6
>>>>>>> upstream/development
} }
useIPv6dialog(){ useIPv6dialog(){
@ -368,7 +369,7 @@ runGravity(){
} }
checkForAndInstallDependencies(){ checkForAndInstallDependencies(){
if [ -d "/var/www/html/admin" ]; then if [ upgrade ]; then
#Likely an existing install, no need to apt-get update #Likely an existing install, no need to apt-get update
echo "::: Previous installation detected" echo "::: Previous installation detected"
else else
@ -379,25 +380,6 @@ checkForAndInstallDependencies(){
fi fi
} }
<<<<<<< HEAD
=======
installPihole()
{
installDependencies
stopServices
$SUDO mkdir -p /etc/pihole/
$SUDO chown www-data:www-data /var/www/html
$SUDO chmod 775 /var/www/html
$SUDO usermod -a -G www-data pi
$SUDO lighty-enable-mod fastcgi fastcgi-php
installScripts
installConfigs
installWebAdmin
installPiholeWeb
installCron
runGravity
>>>>>>> upstream/development
installPihole(){ installPihole(){
installDependencies installDependencies
stopServices stopServices