add reconfigure flag to -r command

This commit is contained in:
Promofaux 2016-10-15 20:43:03 +01:00
parent 7e10dcdcf0
commit a43577fa26
2 changed files with 19 additions and 4 deletions

View file

@ -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

4
pihole
View file

@ -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;
}