Add a general systemd services enabled check function

This commit is contained in:
Pedro Algarvio 2014-02-20 10:57:04 +00:00
parent 5d051e5bdb
commit 1eec518be7

View file

@ -1253,6 +1253,23 @@ movefile() {
return 0
}
#--- FUNCTION -------------------------------------------------------------------------------------------------------
# NAME: __check_services_systemd
# DESCRIPTION: Return 0 or 1 in case the service is enabled or not
# PARAMETERS: servicename
#----------------------------------------------------------------------------------------------------------------------
__check_services_systemd() {
servicename=$?
if [ $(systemctl is-enabled ${servicename}) = "enabled" ]; then
return 0
else
return 1
fi
} # ---------- end of function __check_services_systemd ----------
#######################################################################################################################
#
# Distribution install functions