From: Michael Prokop Date: Fri, 13 Jan 2017 15:05:06 +0000 (+0100) Subject: lsb-functions: avoid usage of SYSTEMD variable X-Git-Tag: v0.13.1~1 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=274a68ff62ffdef8754c2b73bca957f81e16661a lsb-functions: avoid usage of SYSTEMD variable If we're unsetting the SYSTEMD variable again this might influence other code which sources lsb-functions. Since we also have a single usage of systemd in lsb-functions there's no need to use a variable at all --- diff --git a/etc/grml/lsb-functions b/etc/grml/lsb-functions index 4dc8441..de1cd4c 100644 --- a/etc/grml/lsb-functions +++ b/etc/grml/lsb-functions @@ -30,12 +30,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -if [ "$(cat /proc/1/comm 2>/dev/null)" = "systemd" ] ; then - SYSTEMD=true -else - SYSTEMD=false -fi - # log_*() functions {{{ TPUT="${TPUT:-"/usr/bin/tput"}" @@ -419,9 +413,9 @@ ewend() { } #}}} -# if we're using systemd then redfine functions for -# output in systemd style -if $SYSTEMD ; then +# if we're using systemd then redefine functions +# for output in systemd style +if [ "$(cat /proc/1/comm 2>/dev/null)" = "systemd" ] ; then einfo() { printf "[ ${GREEN}OK${NORMAL} ] %s\n" "$*" } @@ -439,7 +433,4 @@ if $SYSTEMD ; then } fi -# don't expose unneeded local variables -unset SYSTEMD - # vim: ft=sh tw=80 ts=4 foldmethod=marker