From 9c41ccce58019cfe2169b82b4a8ec09aff33550a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 3 Apr 2019 15:46:55 +0200 Subject: [PATCH] use shorter .bak suffix approach --- synapse/install.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/synapse/install.sh b/synapse/install.sh index c83ca6512a..2cc68dee03 100755 --- a/synapse/install.sh +++ b/synapse/install.sh @@ -45,11 +45,10 @@ cp -r $BASE_DIR/config-templates/$CONFIG_TEMPLATE/. ./ # Hashes used instead of slashes because we'll get a value back from $(pwd) that'll be # full of un-escapable slashes. -# Manually directing output to .templated file and then manually renaming back on top -# of the original file because -i is a nonstandard sed feature which is implemented -# differently, across os X and ubuntu at least -sed "s#{{SYNAPSE_ROOT}}#$(pwd)/#g" homeserver.yaml > homeserver.yaml.templated && mv homeserver.yaml.templated homeserver.yaml -sed "s#{{SYNAPSE_PORT}}#${PORT}#g" homeserver.yaml > homeserver.yaml.templated && mv homeserver.yaml.templated homeserver.yaml -sed "s#{{FORM_SECRET}}#$(uuidgen)#g" homeserver.yaml > homeserver.yaml.templated && mv homeserver.yaml.templated homeserver.yaml -sed "s#{{REGISTRATION_SHARED_SECRET}}#$(uuidgen)#g" homeserver.yaml > homeserver.yaml.templated && mv homeserver.yaml.templated homeserver.yaml -sed "s#{{MACAROON_SECRET_KEY}}#$(uuidgen)#g" homeserver.yaml > homeserver.yaml.templated && mv homeserver.yaml.templated homeserver.yaml +# Use .bak suffix as using no suffix doesn't work macOS. +sed -i.bak "s#{{SYNAPSE_ROOT}}#$(pwd)/#g" homeserver.yaml +sed -i.bak "s#{{SYNAPSE_PORT}}#${PORT}#g" homeserver.yaml +sed -i.bak "s#{{FORM_SECRET}}#$(uuidgen)#g" homeserver.yaml +sed -i.bak "s#{{REGISTRATION_SHARED_SECRET}}#$(uuidgen)#g" homeserver.yaml +sed -i.bak "s#{{MACAROON_SECRET_KEY}}#$(uuidgen)#g" homeserver.yaml +rm *.bak