diff options
-rwxr-xr-x | bin/svc | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -30,7 +30,7 @@ load_service() XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}" XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}" XDG_CACHE_HOME="${XDG_CACHE_HOME:-${HOME}/.cache}" - PIDDIR="${XDG_CACHE_HOME}/homerc" + PIDDIR="${XDG_CACHE_HOME}/homerc/run" # Default functions stop() { :; } @@ -55,6 +55,9 @@ log() case "${action}" in 'start' | 'stop' | 'restart') eval "printf \"\\r\${msg_${action}${var}}\" \"\${service}\"" + case "${var}" in ?*) + printf '\n' + esac esac return 0 @@ -71,16 +74,14 @@ act() if out="$("${action}" 2>&1)"; then log "${service}" "${action}" '_ok' - case "${out}" in - '') printf '\n';; - *) printf '\n%s\n' "${out}";; + case "${out}" in ?*) + printf '%s\n' "${out}" esac return 0 else log "${service}" "${action}" '_fail' - case "${out}" in - '') printf '\n';; - *) printf '\n%s\n' "${out}";; + case "${out}" in ?*) + printf '%s\n' "${out}" esac return 1 fi |