Why is my operation not working?

I provide virtual machine Vagrant. This is my tramps output, debugging , for my Shellscript:

==> mom1: + enable_https
==> mom1: ++ cat /etc/letsencrypt/live/mom.anevis.solutions/.kpass
==> mom1: + local password=kvnilcFqq+sXmLlonoK1dM=
==> mom1: + sed -i 's,<property name="keyStorePassword" value="password" />,<property name="keyStorePassword" value="kvnilcFqq+sXmLlonoK1dM=" />,' /opt/activemq/conf/jetty.xml

It seems to be working fine, but when I check the file that was supposed to be modified, it is empty!

<property name="keyStorePassword" value="" />

This is my shell script:

enable_https(){
  local kpass=$(cat /etc/letsencrypt/live/company.com/.kpass)
  sed -i "s,<property name=\"keyStorePassword\" value=\"password\" />,<property name=\"keyStorePassword\" value=\"${kpass}\" />," /opt/activemq/conf/jetty.xml
}

The funny thing is that when I try to use the same script locally, it works, but not when I try to use it while providing Vagrant.

Any suggestion?:)

+4
source share
2 answers

, , my sed, , script. , sed . , .

0

, :
sed -i "s/<property name=\"keyStorePassword\" value=\"password\" \/>/<property name=\"keyStorePassword\" value=\"${kpass}\" \/>/" /opt/activemq/conf/jetty.xml

, ${kpass} .

+1

All Articles