X-Git-Url: http://git.steven-mcdonald.id.au/?p=aids.git;a=blobdiff_plain;f=bin%2Faids;h=d5869f788394a983907bb7cb4374f551d98d18ef;hp=5388ea942bba7414a2768b0930a6de3a332ad31c;hb=4eff9f266269e6d82fe7aad9052fe96fde8e0651;hpb=9cc785ad2630eb938c89f92b4f8999fa3ebd3570 diff --git a/bin/aids b/bin/aids index 5388ea9..d5869f7 100755 --- a/bin/aids +++ b/bin/aids @@ -1,6 +1,16 @@ #!/usr/bin/ruby1.8 -require 'lib/aids' +# Copyright (C) 2012 Steven McDonald +# +# This program is free software. It comes without any warranty, to the +# extent permitted by applicable law. You can redistribute it and/or +# modify it under the terms of the Do What The Fuck You Want To Public +# License, Version 2, as published by Sam Hocevar. See the file COPYING +# in the root of this program's source distribution for details, or: +# +# http://sam.zoy.org/wtfpl/COPYING + +require 'aids' def main(argv) svc = AIDS::Service.new(argv[1]) if argv[1] @@ -23,9 +33,11 @@ def main(argv) end def display_status(svc) - print "#{svc.name[0..14]}:#{' ' * (16 - svc.name[0..14].length)}" + print "#{svc.name[0..14]}#{' ' * (16 - svc.name[0..14].length)}" status = svc.status + prettystatus = nil AIDS::RUNLEVEL_ALL.each do |r| + print "\t" if prettystatus case status[r] when :start prettystatus = 'on' @@ -36,7 +48,7 @@ def display_status(svc) else next end - print "#{r}: #{prettystatus + ' ' * (8 - prettystatus.length)}" + print "#{r}:#{prettystatus}" end puts end