From 2f2e746e560ac14da332ecc8c2edffa35384f8bd Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 21 Aug 2016 02:23:11 +0100 Subject: [PATCH] Add update function to pihole script --- pihole | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pihole b/pihole index 3403effa..0791a023 100755 --- a/pihole +++ b/pihole @@ -52,6 +52,14 @@ function updateDashboardFunc { exit 1 } +function updateMainFunc { + echo "::: Fetching latest changes from Github..." + cd /etc/.pihole + ${SUDO} git pull + ${SUDO} /etc/.pihole/automated install/basic-install.sh + exit 1 +} + function updateGravityFunc { ${SUDO} /opt/pihole/gravity.sh "$@" exit 1 @@ -91,6 +99,7 @@ function helpFunc { echo "::: -d, debug Start a debugging session if having trouble" echo "::: -f, flush Flush the pihole.log file" echo "::: -u, updateDashboard Update the web dashboard manually" + echo "::: -U, updateMain Update Pi-hole" echo "::: -g, updateGravity Update the list of ad-serving domains" echo "::: -s, setupLCD Automatically configures the Pi to use the 2.8 LCD screen to display stats on it" echo "::: -c, chronometer Calculates stats and displays to an LCD" @@ -111,6 +120,7 @@ case "$1" in "-d" | "debug" ) debugFunc;; "-f" | "flush" ) flushFunc;; "-u" | "updateDashboard" ) updateDashboardFunc;; +"-U" | "updateMain" ) updateMainFunc;; "-g" | "updateGravity" ) updateGravityFunc "$@";; "-s" | "setupLCD" ) setupLCDFunction;; "-c" | "chronometer" ) chronometerFunc "$@";;