From: Michael Biebl Date: Sat, 1 Dec 2018 22:07:47 +0000 (+0100) Subject: 40-systemd: Use case instead of if statement X-Git-Tag: debian/247.3-7+deb11u1~459 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e23edb75e484f097510b83fa76588434941b41e4;p=systemd.git 40-systemd: Use case instead of if statement Makes it more readable and is also a bit faster. Gbp-Dch: Ignore --- diff --git a/debian/extra/init-functions.d/40-systemd b/debian/extra/init-functions.d/40-systemd index 4e6222add..4fa9b9c68 100644 --- a/debian/extra/init-functions.d/40-systemd +++ b/debian/extra/init-functions.d/40-systemd @@ -92,15 +92,10 @@ if [ "$_use_systemctl" = "1" ]; then set +e set +u - if [ "x$argument" = xstart -o \ - "x$argument" = xstop -o \ - "x$argument" = xrestart -o \ - "x$argument" = xreload -o \ - "x$argument" = xforce-reload -o \ - "x$argument" = xtry-restart -o \ - "x$argument" = xstatus ] ; then - - systemctl_redirect $executable $argument - exit $? - fi + case "$argument" in + start|stop|restart|reload|force-reload|try-restart|status) + systemctl_redirect $executable $argument + exit $? + ;; + esac fi