aboutsummaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2017-10-23 23:20:31 +0300
committerDee'Kej <deekej@linuxmail.org>2017-10-30 17:05:05 +0100
commit9170aa51fd4e8336cc34db3a1aa29989a024b50c (patch)
treec2aa704e664034cd5f80f3a943c10e64b9386d66 /service
parent5829c811dd082ac046846bb932d9d14fbc777c17 (diff)
downloadinitscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar
initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar.gz
initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar.bz2
initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.tar.xz
initscripts-9170aa51fd4e8336cc34db3a1aa29989a024b50c.zip
Avoid some unnecessary stat calls
Diffstat (limited to 'service')
-rwxr-xr-xservice2
1 files changed, 1 insertions, 1 deletions
diff --git a/service b/service
index 9b25e85d..f3c524ae 100755
--- a/service
+++ b/service
@@ -79,7 +79,7 @@ if [ -f "${SERVICEDIR}/${SERVICE}" ]; then
/bin/systemctl stop ${SERVICE}.service
fi
env -i PATH="$PATH" TERM="$TERM" SYSTEMCTL_IGNORE_DEPENDENCIES=${SYSTEMCTL_IGNORE_DEPENDENCIES} SYSTEMCTL_SKIP_REDIRECT=${SYSTEMCTL_SKIP_REDIRECT} "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS}
-elif [ -x "${ACTIONDIR}/${SERVICE}/${ACTION}" -a -n "${ACTION}" ]; then
+elif [ -n "${ACTION}" ] && [ -x "${ACTIONDIR}/${SERVICE}/${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})