mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
move repo clone to function
This commit is contained in:
parent
bd07d7f32e
commit
dfdb9e393b
@ -1096,6 +1096,25 @@ update_dialogs() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clone_or_update_repos() {
|
||||||
|
if [[ "${reconfigure}" == true ]]; then
|
||||||
|
echo "::: --reconfigure passed to install script. Not downloading/updating local repos"
|
||||||
|
else
|
||||||
|
# Get Git files for Core and Admin
|
||||||
|
getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || \
|
||||||
|
{ echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \
|
||||||
|
exit 1; \
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ${INSTALL_WEB} == true ]]; then
|
||||||
|
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \
|
||||||
|
{ echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \
|
||||||
|
exit 1; \
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
||||||
######## FIRST CHECK ########
|
######## FIRST CHECK ########
|
||||||
@ -1161,19 +1180,6 @@ main() {
|
|||||||
# Check if SELinux is Enforcing
|
# Check if SELinux is Enforcing
|
||||||
checkSelinux
|
checkSelinux
|
||||||
|
|
||||||
if [[ "${reconfigure}" == true ]]; then
|
|
||||||
echo "::: --reconfigure passed to install script. Not downloading/updating local repos"
|
|
||||||
else
|
|
||||||
# Get Git files for Core and Admin
|
|
||||||
getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || \
|
|
||||||
{ echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \
|
|
||||||
exit 1; \
|
|
||||||
}
|
|
||||||
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \
|
|
||||||
{ echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \
|
|
||||||
exit 1; \
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${useUpdateVars} == false ]]; then
|
if [[ ${useUpdateVars} == false ]]; then
|
||||||
# Display welcome dialogs
|
# Display welcome dialogs
|
||||||
@ -1195,6 +1201,8 @@ main() {
|
|||||||
setAdminFlag
|
setAdminFlag
|
||||||
# Let the user decide if they want query logging enabled...
|
# Let the user decide if they want query logging enabled...
|
||||||
setLogging
|
setLogging
|
||||||
|
# Clone/Update the repos
|
||||||
|
clone_or_update_repos
|
||||||
|
|
||||||
# Install packages used by the Pi-hole
|
# Install packages used by the Pi-hole
|
||||||
install_dependent_packages PIHOLE_DEPS[@]
|
install_dependent_packages PIHOLE_DEPS[@]
|
||||||
@ -1205,6 +1213,8 @@ main() {
|
|||||||
# Install and log everything to a file
|
# Install and log everything to a file
|
||||||
installPihole | tee ${tmpLog}
|
installPihole | tee ${tmpLog}
|
||||||
else
|
else
|
||||||
|
# Clone/Update the repos
|
||||||
|
clone_or_update_repos
|
||||||
# update packages used by the Pi-hole
|
# update packages used by the Pi-hole
|
||||||
install_dependent_packages PIHOLE_DEPS[@]
|
install_dependent_packages PIHOLE_DEPS[@]
|
||||||
if [[ ${INSTALL_WEB} == true ]]; then
|
if [[ ${INSTALL_WEB} == true ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user