1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Add updatePihole method

This commit is contained in:
Promofaux 2016-08-19 22:45:24 +01:00
parent f54828352d
commit fdb104348c

View File

@ -828,6 +828,52 @@ installPihole() {
configureFirewall
}
installPihole() {
# Install base files and web interface
checkForDependencies # done
stopServices
setUser
${SUDO} mkdir -p /etc/pihole/
if [ ! -d "/var/www/html" ]; then
${SUDO} mkdir -p /var/www/html
fi
${SUDO} chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/www/html
${SUDO} chmod 775 /var/www/html
${SUDO} usermod -a -G ${LIGHTTPD_GROUP} pihole
if [ -x "$(command -v lighty-enable-mod)" ]; then
${SUDO} lighty-enable-mod fastcgi fastcgi-php > /dev/null
else
printf "\n:::\tWarning: 'lighty-enable-mod' utility not found. Please ensure fastcgi is enabled if you experience issues.\n"
fi
getGitFiles
installScripts
installConfigs
installConfigs
CreateLogFile
configureSelinux
installPiholeWeb
installCron
runGravity
configureFirewall
}
updatePihole() {
# Install base files and web interface
checkForDependencies # done
stopServices
getGitFiles
installScripts
installConfigs
installConfigs
CreateLogFile
configureSelinux
installPiholeWeb
installCron
runGravity
configureFirewall
}
configureSelinux() {
if [ -x "$(command -v getenforce)" ]; then
printf "\n::: SELinux Detected\n"
@ -908,12 +954,9 @@ if [[ ${useUpdateVars} == false ]]; then
# Install and log everything to a file
installPihole | tee ${tmpLog}
else
echo "Hi!"
updatePihole | tee ${tmpLog}
fi
# Move the log file into /etc/pihole for storage
${SUDO} mv ${tmpLog} ${instalLogLoc}