From 9ba8bba8f52ac9f162e8931165f03414ecda82be Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Fri, 6 Sep 2024 15:52:51 +0300 Subject: [PATCH] new updater --- update.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 update.sh diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..5c398b3 --- /dev/null +++ b/update.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +PARAMETER=$1 +NEW_VALUE=$2 + +# Список файлов +FILES=( + "./config.json" + ".env" +) + +for FILE in "${FILES[@]}"; do + EXPANDED_FILE=$(eval echo "$FILE") + sed -i "s|###$PARAMETER###|$NEW_VALUE|g" "$EXPANDED_FILE" +done \ No newline at end of file