Fixes service functions return code
This commit is contained in:
parent
9fd8dcbca0
commit
eb501d3b93
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user