summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/svc14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/svc b/bin/svc
index df12e4a..e97e915 100755
--- a/bin/svc
+++ b/bin/svc
@@ -56,9 +56,6 @@ log()
case "${action}" in 'start' | 'stop' | 'restart')
eval "printf \"\\r\${msg_${action}${var}}\" \"\${service}\""
esac
- case "${var}" in ?*)
- printf '\n'
- esac
return 0
}
@@ -68,16 +65,25 @@ act()
local service="${1}"
local action="${2}"
shift 2
+ local out=
local es=
log "${service}" "${action}" ''
- if "${action}"; then
+ if out="$("${action}" 2>&1)"; then
log "${service}" "${action}" '_ok'
+ case "${out}" in
+ '') printf '\n';;
+ *) printf '\n%s\n' "${out}";;
+ esac
return 0
else
es=${?}
log "${service}" "${action}" '_fail'
+ case "${out}" in
+ '') printf '\n';;
+ *) printf '\n%s\n' "${out}";;
+ esac
return ${es}
fi
}