mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 04:30:55 +00:00
Exit early when neither service nor systemctl commands are available (#5834)
This commit is contained in:
commit
3406915917
@ -2328,6 +2328,17 @@ migrate_dnsmasq_configs() {
|
||||
mv /etc/dnsmasq.d/06-rfc6761.conf "${V6_CONF_MIGRATION_DIR}/" 2>/dev/null || true
|
||||
}
|
||||
|
||||
# Check for availability of either the "service" or "systemctl" commands
|
||||
check_service_command() {
|
||||
# Check for the availability of the "service" command
|
||||
if ! is_command service && ! is_command systemctl; then
|
||||
# If neither the "service" nor the "systemctl" command is available, inform the user
|
||||
printf " %b Neither the service nor the systemctl commands are available\\n" "${CROSS}"
|
||||
printf " on this machine. This Pi-hole installer cannot continue.\\n"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
######## FIRST CHECK ########
|
||||
# Must be root to install
|
||||
@ -2376,6 +2387,9 @@ main() {
|
||||
# Check if SELinux is Enforcing and exit before doing anything else
|
||||
checkSelinux
|
||||
|
||||
# Check for availability of either the "service" or "systemctl" commands
|
||||
check_service_command
|
||||
|
||||
# Check for supported package managers so that we may install dependencies
|
||||
package_manager_detect
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user