diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 945fa1e1..ccb84667 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -40,6 +40,11 @@ columns=$(tput cols) r=$(( rows / 2 )) c=$(( columns / 2 )) +######## Flags. Shhh ######## +skipSpaceCheck=false +skipRepoUpdate=false +runUnattended=false + ######## FIRST CHECK ######## # Must be root to install echo ":::" @@ -884,8 +889,18 @@ update_dialogs(){ } main() { + +for var in "$@" +do + case "$var" in + "--reconfigure" ) skipRepoUpdate=true;; + "--i_do_not_follow_recommendations" ) skipSpaceCheck=false;; + "--unattended" ) runUnattended=true;; + esac +done + if [[ -f ${setupVars} ]];then - if [ "$1" == "pihole" ]; then + if [ "$runUnattended" = true ]; then useUpdateVars=true else update_dialogs @@ -894,7 +909,7 @@ fi # Start the installer # Verify there is enough disk space for the install -if [[ $1 = "--i_do_not_follow_recommendations" ]]; then +if [[ "$skipSpaceCheck" = true ]]; then echo "::: --i_do_not_follow_recommendations passed to script" echo "::: skipping free disk space verification!" else diff --git a/pihole b/pihole index 30b13403..4ed446be 100755 --- a/pihole +++ b/pihole @@ -99,7 +99,7 @@ updatePiholeFunc() { echo "::: Fetching latest changes from GitHub..." cd /etc/.pihole git pull origin master - /etc/.pihole/automated\ install/basic-install.sh pihole + /etc/.pihole/automated\ install/basic-install.sh --unattended echo ":::" echo "::: Pi-hole has been updated to version ${piholeVersionLatest}" @@ -114,7 +114,7 @@ updatePiholeFunc() { } reconfigurePiholeFunc() { - /etc/.pihole/automated\ install/basic-install.sh + /etc/.pihole/automated\ install/basic-install.sh --reconfigure exit 0; }