Fixes service functions return code

This commit is contained in:
Bruno Tavares 2015-05-23 23:38:36 -03:00
parent 9fd8dcbca0
commit eb501d3b93

View File

@ -1,24 +1,33 @@
kickstart.service.enable() {
kickstart.command_exists enable && enable "$1"
kickstart.command_exists systemctl && systemctl enable "$1"
kickstart.os.is "Mac" && kickstart.info "Mac services not supported yet"
exit_status=0
kickstart.command_exists enable && enable "$1" && exit_status=$?
kickstart.command_exists systemctl && systemctl enable "$1" && exit_status=$?
kickstart.os.is "Mac" && kickstart.info "Mac services not supported yet" && exit_status=1
return $exit_status
}
kickstart.service.disable() {
kickstart.command_exists disable && disable "$1"
kickstart.command_exists systemctl && systemctl disable "$1"
exit_status=0
kickstart.command_exists disable && disable "$1" && exit_status=$?
kickstart.command_exists systemctl && systemctl disable "$1" && exit_status=$?
kickstart.os.is "Mac" && kickstart.info "Mac services not supported yet"
return $exit_status
}
kickstart.service.start() {
kickstart.command_exists start && start "$1"
kickstart.command_exists systemctl && systemctl start "$1"
kickstart.os.is "Mac" && kickstart.info "Mac services not supported yet"
exit_status=0
kickstart.command_exists start && start "$1" && exit_status=$?
kickstart.command_exists systemctl && systemctl start "$1" && exit_status=$?
kickstart.os.is "Mac" && kickstart.info "Mac services not supported yet" && exit_status=1
return $exit_status
}
kickstart.service.stop() {
kickstart.command_exists stop && stop "$1"
kickstart.command_exists systemctl && systemctl stop "$1"
kickstart.os.is "Mac" && kickstart.info "Mac services not supported yet"
exit_status=0
kickstart.command_exists stop && stop "$1" && exit_status=$?
kickstart.command_exists systemctl && systemctl stop "$1" && exit_status=$?
kickstart.os.is "Mac" && kickstart.info "Mac services not supported yet" && exit_status=1
return $exit_status
}
kickstart.service.restart() {