mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Add a general systemd services enabled check function
This commit is contained in:
parent
5d051e5bdb
commit
1eec518be7
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue