Using SED to move a value after equals to a matching file



I have tried multiple things when moving the keystorePass value from one server.xml to another. I am not very good with sed but have tried multiple things including using patterns, i also used grep to take that specific line with the keystore password to a blank file and move the line to the new server.xml but that did not work either. Everyone probably already knows what the server.xml usually contains but here is an example of the section i need fixed.


**



keystoreFile="/etc/blank"
keystorePass="BLAH" sslProtocol = "TLS" />


**


Now when we deliver a build we have our own set of server.xml which only works with our servers but when our users deploy it they use a different keystorePass. I was just having it to where the file is moved back over once the build is finished but we sometimes need to make some edits to the file so it must be replaced. All in all i need the password after keystorePass= in server.xml1 to replace the one in server.xml2



server.xml (Test)
keystoreFile="/etc/blank/"
keystorePass="BadPassword" sslProtocol = "TLS" />


server.xml (Customer)
keystoreFile="/etc/blank/"
keystorePass="GoodPassword" sslProtocol = "TLS" />


Thanks in advance


No comments:

Post a Comment