From 19825d55613dee10f08934f788a8798c8356681f Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sat, 8 Jun 2024 20:13:10 +0300 Subject: [PATCH] Create update.sh Signed-off-by: vvzvlad --- update.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..cdc05cf --- /dev/null +++ b/update.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +WALLET_ADDRESS=$1 +PRIVATE_KEY=$2 + +# Список файлов +FILES=( + "./projects/hello-world/container/config.json" + "./projects/hello-world/contracts/Makefile" +) + +for FILE in "${FILES[@]}"; do + EXPANDED_FILE=$(eval echo "$FILE") + sed -i "s/###WALLET_ADDRESS###/$WALLET_ADDRESS/g" "$EXPANDED_FILE" + sed -i "s/###PRIVATE_KEY###/$PRIVATE_KEY/g" "$EXPANDED_FILE" +done