`service status`: improved UI
parent
efc31bac79
commit
925a8ee0fd
|
@ -10,8 +10,10 @@ Service.load RC_DIRECTORY
|
||||||
LibC.setuid 0
|
LibC.setuid 0
|
||||||
LibC.setgid 0
|
LibC.setgid 0
|
||||||
|
|
||||||
|
list_status = false
|
||||||
services = ARGV
|
services = ARGV
|
||||||
if services.size == 0
|
if services.size == 0
|
||||||
|
list_status = true
|
||||||
services = Service.all
|
services = Service.all
|
||||||
else
|
else
|
||||||
services = services.map do |id|
|
services = services.map do |id|
|
||||||
|
@ -19,7 +21,7 @@ else
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if services.size == 1
|
if services.size == 1 && ! list_status
|
||||||
services[0]?.try do |service|
|
services[0]?.try do |service|
|
||||||
puts service.status PID_DIRECTORY
|
puts service.status PID_DIRECTORY
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue