From 0a465125cbd589d12d3e8f56c5a4abfa32a49494 Mon Sep 17 00:00:00 2001 From: Christophe Biocca Date: Fri, 12 Sep 2014 10:28:47 -0400 Subject: [PATCH] Allows profile file to work on pathmunge-less systems. Will check for pathmunge's existence and use it, or fallback to prepending to the path. --- tools/profile.d-usrblackbox.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/profile.d-usrblackbox.sh b/tools/profile.d-usrblackbox.sh index 6c69b47..5b1106b 100644 --- a/tools/profile.d-usrblackbox.sh +++ b/tools/profile.d-usrblackbox.sh @@ -1,2 +1,7 @@ # Prepend to $PATH. -pathmunge /usr/blackbox/bin + +if type pathmunge > /dev/null 2>&1 ; then + pathmunge /usr/blackbox/bin +elif ! echo $PATH | grep -Eq "(^|:)/usr/blackbox/bin($|:)" ; then + PATH=/usr/blackbox/bin:$PATH +fi