From c3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Thu, 20 Oct 2016 10:02:30 +0200 Subject: service: avoid double spaces in systemctl commands When running: ``` service x restart ``` You get: ``` Redirecting to /bin/systemctl restart x.service ``` With 2 spaces after restart. This commits fixes that behaviour. Signed-off-by: Julien Pivotto --- service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service b/service index fc3c7dd0..9b25e85d 100755 --- a/service +++ b/service @@ -83,7 +83,7 @@ elif [ -x "${ACTIONDIR}/${SERVICE}/${ACTION}" -a -n "${ACTION}" ]; then env -i PATH="$PATH" TERM="$TERM" SYSTEMCTL_IGNORE_DEPENDENCIES=${SYSTEMCTL_IGNORE_DEPENDENCIES} SYSTEMCTL_SKIP_REDIRECT=${SYSTEMCTL_SKIP_REDIRECT} "${ACTIONDIR}/${SERVICE}/${ACTION}" ${OPTIONS} elif `echo $ACTION | egrep -qw "start|stop|restart|try-restart|reload|force-reload|status|condrestart"` ; then SERVICE_MANGLED=$(/usr/bin/systemd-escape --mangle ${SERVICE}) - echo $"Redirecting to /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE_MANGLED}" >&2 + echo $"Redirecting to /bin/systemctl ${ACTION}${OPTIONS:+ }${OPTIONS} ${SERVICE_MANGLED}" >&2 exec /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE_MANGLED} else echo $"The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl." >&2 -- cgit v1.2.1