timberline-secondary / hackerspace-scripts

Scripts for managing the Hackerspace's network
1 stars 2 forks source link

bootstrap adds PATH= line to .profile on every run! #28

Open tylerecouture opened 7 years ago

tylerecouture commented 7 years ago

It should check if it's already there, if not, add it.

Put the line in a variable, then check if it's there with something like: https://stackoverflow.com/questions/4749330/how-to-test-if-string-exists-in-file-with-bash-shell

tylerecouture commented 6 years ago

Add a check to see if it exists first using grep, something like this:

if ! echo $PATH | grep -q /opt/puppetlabs/bin ; then
  export PATH=$PATH:/opt/puppetlabs/bin
fi