diff options
author | 2014-08-21 12:47:22 +0000 | |
---|---|---|
committer | 2014-08-21 12:47:22 +0000 | |
commit | c18897cf0c601c1fa9862913d4e730271f53339c (patch) | |
tree | f79c245f1484ed3779cb2d879e15b2ba8f5eddfe | |
parent | Misleading comments about splnet(). (diff) | |
download | wireguard-openbsd-c18897cf0c601c1fa9862913d4e730271f53339c.tar.xz wireguard-openbsd-c18897cf0c601c1fa9862913d4e730271f53339c.zip |
Make "rcctl status" output match rc.conf(8) format.
ok jasper@
-rw-r--r-- | usr.sbin/rcctl/rcctl.8 | 8 | ||||
-rw-r--r-- | usr.sbin/rcctl/rcctl.sh | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/rcctl/rcctl.8 b/usr.sbin/rcctl/rcctl.8 index de103767956..c8997b49ff0 100644 --- a/usr.sbin/rcctl/rcctl.8 +++ b/usr.sbin/rcctl/rcctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rcctl.8,v 1.4 2014/08/21 10:15:11 schwarze Exp $ +.\" $OpenBSD: rcctl.8,v 1.5 2014/08/21 12:47:22 ajacoutot Exp $ .\" .\" Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org> .\" @@ -64,8 +64,10 @@ Display the value of .Ar service or .Ar daemon Ns _flags . -Without an argument, list all services and daemons -with their current status and flags. +Without an argument, display all services and +.Ar daemon Ns _flags +with their values in a format compatible with +.Xr rc.conf 8 . .It Ar action daemon Run the .Xr rc.d 8 diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index b70f3f4523c..2e351fc4ddb 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -103,16 +103,15 @@ svc_get_flags() svc_get_status() { - local _svc=$1 + local _affix _svc=$1 if [ -n "${_svc}" ]; then svc_get_flags ${_svc} | sed '/^$/d' svc_is_enabled ${_svc} else for _i in $(svc_get_all); do - printf "%18s" ${_i} - echo -n "\tflags=" - svc_get_flags ${_i} + svc_is_special ${_i} && unset _affix || _affix="_flags" + echo "${_i}${_affix}=$(svc_get_flags ${_i})" done fi } |