Use gnused in scripts

This commit is contained in:
willclarktech
2021-06-09 17:15:02 +02:00
parent 7115fb265f
commit 81821a9e5a
7 changed files with 23 additions and 9 deletions
+4 -2
View File
@@ -2,6 +2,8 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"
gnused="$(command -v gsed || echo sed)"
SCRIPT_DIR="$(realpath "$(dirname "$0")")"
# shellcheck source=./env
# shellcheck disable=SC1091
@@ -47,7 +49,7 @@ function inline_jq() {
inline_jq "template/.wasmd/config/genesis.json" -S
# Custom settings in config.toml
sed -i "" \
"$gnused" -i \
-e 's/^cors_allowed_origins =.*$/cors_allowed_origins = ["*"]/' \
-e 's/^timeout_propose =.*$/timeout_propose = "300ms"/' \
-e 's/^timeout_propose_delta =.*$/timeout_propose_delta = "100ms"/' \
@@ -59,7 +61,7 @@ function inline_jq() {
"template/.wasmd/config/config.toml"
# Custom settings app.toml
sed -i "" \
"$gnused" -i \
-e 's/^enable =.*$/enable = true/' \
-e 's/^enabled-unsafe-cors =.*$/enabled-unsafe-cors = true/' \
"template/.wasmd/config/app.toml"