We have two bootstraps of Chef in our environment which are identified by colour:
I'm attempting to identify which version is installed based on the name of the file. So far I've been able to use the following find command to help me identify the full name:
find /var/chef/cache/cookbooks/ -name "bootstrap*" -print
I think I need to redirect the result using
2>/dev/null and then pipe to use grep and identify if the filename has red or green in the name or the name isn't found.
I'd like to be able to make the report a little cleaner by reporting back if the filename had either "red" or "green" or couldn't find the file.
One more requirement is that I would like to have this command in a one liner if possible.
Thanks in advance for any advice you can provide me.