I have set environment properties in elasticbeanstalk, Property Name: spring.profiles.active
, Property Value: qa
.
On spring application deploy this value is correctly read by using ps -aef | grep tomcat
from terminal.
I want to be able to read this environment property in a shell script and extract the value "qa" which I use to configure other items on the server.
Is this possible and if so, how do I do it.
OK I found out how to get the result I was looking for.
Here is the command:
ps -aef | grep tomcat | grep -Po 'spring.profiles.active=\K[^ ]+'
If someone has a cleaner or better way of doing this I will gladly accept it.
G
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With