From f852193495d913a0d95b944c4fad12ffc2be46b5 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 28 Mar 2016 03:07:42 -0400 Subject: [PATCH] polish lsf_startup --- xCAT/postscripts/lsf_startup | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xCAT/postscripts/lsf_startup b/xCAT/postscripts/lsf_startup index 93c539b3d..a8dd3bee9 100644 --- a/xCAT/postscripts/lsf_startup +++ b/xCAT/postscripts/lsf_startup @@ -59,13 +59,18 @@ for lsfnode in $ALL_LSF_NODES do if [[ x${lsfnode} == x$NODE ]] then - if [[ -f /root/.bash_profile ]] - then - - echo ". $LSF_TOP/conf/profile.lsf" >> /root/.bash_profile + then + if ! grep -q -i "#Added by lsf_startup" /root/.bash_profile ; then + echo "#Added by lsf_startup." + echo ". $LSF_TOP/conf/profile.lsf" >> /root/.bash_profile + fi else - echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile + if ! grep -q -i "#Added by lsf_startup" /root/.profile ; then + echo "#Added by lsf_startup." + echo ". $LSF_TOP/conf/profile.lsf" >> /root/.profile + fi + fi fi done