Warn the developer on wrong function usage

This commit is contained in:
Pedro Algarvio 2014-02-20 11:44:01 +00:00
parent 96e9812d1c
commit 5d0fdd25c8

View file

@ -1261,6 +1261,12 @@ movefile() {
# PARAMETERS: servicename
#----------------------------------------------------------------------------------------------------------------------
__check_services_systemd() {
if [ $# -eq 0 ]; then
echoerror "You need to pass a service name to check!"
exit 1
elif [ $# -ne 0 ]; then
echoerror "You need to pass a service name to check as the single argument to the function"
fi
servicename=$?
if [ $(systemctl is-enabled ${servicename}) = "enabled" ]; then
return 0