-.\" $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>
.\"
.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
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
}