mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-05 05:30:55 +00:00
Exit early when neither service nor systemctl commands are available
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
a9948304db
commit
a2a22c4e13
@ -2328,6 +2328,17 @@ migrate_dnsmasq_configs() {
|
|||||||
mv /etc/dnsmasq.d/06-rfc6761.conf "${V6_CONF_MIGRATION_DIR}/" 2>/dev/null || true
|
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() {
|
main() {
|
||||||
######## FIRST CHECK ########
|
######## FIRST CHECK ########
|
||||||
# Must be root to install
|
# Must be root to install
|
||||||
@ -2376,6 +2387,9 @@ main() {
|
|||||||
# Check if SELinux is Enforcing and exit before doing anything else
|
# Check if SELinux is Enforcing and exit before doing anything else
|
||||||
checkSelinux
|
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
|
# Check for supported package managers so that we may install dependencies
|
||||||
package_manager_detect
|
package_manager_detect
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user