aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Pivotto <roidelapluie@inuits.eu>2016-10-20 10:02:30 +0200
committerLukáš Nykrýn <lnykryn@redhat.com>2016-10-20 10:25:51 +0200
commitc3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73 (patch)
treeb85cc252b6be9a7aa1c086d9aac892941cbb1bcb
parent14cf7c177935c04bf785677a2946ea0a0c0df491 (diff)
downloadinitscripts-c3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73.tar
initscripts-c3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73.tar.gz
initscripts-c3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73.tar.bz2
initscripts-c3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73.tar.xz
initscripts-c3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73.zip
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 <roidelapluie@inuits.eu>
-rwxr-xr-xservice2
1 files changed, 1 insertions, 1 deletions
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