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