mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Refactor stopServices
into stop_service
and accept arguments for service to stop. Quiet output from a few other functions.
This commit is contained in:
parent
43e2aaebf0
commit
5287ea8537
@ -567,15 +567,15 @@ installConfigs() {
|
|||||||
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress
|
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress
|
||||||
}
|
}
|
||||||
|
|
||||||
stopServices() {
|
stop_service() {
|
||||||
# Stop dnsmasq and lighttpd
|
# Stop service passed in as argument.
|
||||||
|
# Can softfail, as process may not be installed when this is called
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo -n "::: Stopping services..."
|
echo -n "::: Stopping ${1} service..."
|
||||||
#$SUDO service dnsmasq stop & spinner $! || true
|
|
||||||
if [ -x "$(command -v systemctl)" ]; then
|
if [ -x "$(command -v systemctl)" ]; then
|
||||||
systemctl stop lighttpd & spinner $! || true
|
systemctl stop "${1}" &> /dev/null & spinner $! || true
|
||||||
else
|
else
|
||||||
service lighttpd stop & spinner $! || true
|
service "${1}" &> /dev/null stop & spinner $! || true
|
||||||
fi
|
fi
|
||||||
echo " done."
|
echo " done."
|
||||||
}
|
}
|
||||||
@ -642,7 +642,7 @@ getGitFiles() {
|
|||||||
is_repo() {
|
is_repo() {
|
||||||
# Use git to check if directory is currently under VCS
|
# Use git to check if directory is currently under VCS
|
||||||
echo -n "::: Checking $1 is a repo..."
|
echo -n "::: Checking $1 is a repo..."
|
||||||
cd "${1}" || return 1
|
cd "${1}" &> /dev/null || return 1
|
||||||
git status &> /dev/null && echo " OK!"; return 0 || echo " not found!"; return 1
|
git status &> /dev/null && echo " OK!"; return 0 || echo " not found!"; return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -768,7 +768,6 @@ finalExports() {
|
|||||||
|
|
||||||
installPihole() {
|
installPihole() {
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
stopServices
|
|
||||||
setUser
|
setUser
|
||||||
if [ ! -d "/var/www/html" ]; then
|
if [ ! -d "/var/www/html" ]; then
|
||||||
mkdir -p /var/www/html
|
mkdir -p /var/www/html
|
||||||
@ -794,7 +793,6 @@ installPihole() {
|
|||||||
|
|
||||||
updatePihole() {
|
updatePihole() {
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
stopServices
|
|
||||||
installScripts
|
installScripts
|
||||||
installConfigs
|
installConfigs
|
||||||
CreateLogFile
|
CreateLogFile
|
||||||
@ -905,6 +903,9 @@ if [[ ${useUpdateVars} == false ]]; then
|
|||||||
# Get Git files for Core and Admin
|
# Get Git files for Core and Admin
|
||||||
getGitFiles ${piholeFilesDir} ${piholeGitUrl}
|
getGitFiles ${piholeFilesDir} ${piholeGitUrl}
|
||||||
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl}
|
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl}
|
||||||
|
# Stop resolver and webserver while installing proceses
|
||||||
|
stop_service dnsmasq
|
||||||
|
stop_service lighttpd
|
||||||
# Find IP used to route to outside world
|
# Find IP used to route to outside world
|
||||||
findIPRoute
|
findIPRoute
|
||||||
# Find interfaces and let the user choose one
|
# Find interfaces and let the user choose one
|
||||||
|
Loading…
Reference in New Issue
Block a user