From 57f7187fdff1e8bfed5503327c52b2b1f9b1b54c Mon Sep 17 00:00:00 2001 From: Yorick Date: Sun, 5 May 2024 12:57:18 +0000 Subject: [PATCH] Fix ext-network handling --- .gitignore | 1 + ethd | 16 ++++++++++++++-- ext-network.yml => ext-network.yml.sample | 0 3 files changed, 15 insertions(+), 2 deletions(-) rename ext-network.yml => ext-network.yml.sample (100%) diff --git a/.gitignore b/.gitignore index 0bb94bb8..2077c98b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ docker-compose.yml ext-network.yml ext-network.yml.original +ext-network.yml.bak .eth/* !.eth/README.md !.eth/validator_keys/.empty diff --git a/ethd b/ethd index dc548866..12970bb8 100755 --- a/ethd +++ b/ethd @@ -199,6 +199,10 @@ prep_conffiles() { if [ ! -f "ssv-config/config.yaml" ]; then ${__as_owner} cp ssv-config/config-sample.yaml ssv-config/config.yaml fi +# Create ext-network.yml if it doesn't exist + if [ ! -f "ext-network.yml" ]; then + ${__as_owner} cp ext-network.yml.sample ext-network.yml + fi } @@ -1203,9 +1207,14 @@ update() { fi if [ -z "${ETHDSECUNDO-}" ]; then - # Do not track changes to ext-network.yml set +e - ${__as_owner} git update-index --assume-unchanged ext-network.yml + __fix_extnetwork=0 + if [ ! -f ext-network.yml.sample ]; then + __fix_extnetwork=1 + ${__as_owner} git update-index --no-assume-unchanged ext-network.yml + ${__as_owner} cp ext-network.yml ext-network.yml.bak + ${__as_owner} git restore ext-network.yml + fi ${__as_owner} git config pull.rebase false var="ETH_DOCKER_TAG" value=$(sed -n -e "s/^${var}=\(.*\)/\1/p" "${ENV_FILE}" || true) @@ -1216,6 +1225,9 @@ update() { git checkout main fi ${__as_owner} git pull origin main + if [ "${__fix_extnetwork}" -eq 1 ]; then + ${__as_owner} cp ext-network.yml.bak ext-network.yml + fi else export ETHDPINNED="${value}" ${__as_owner} git fetch --tags diff --git a/ext-network.yml b/ext-network.yml.sample similarity index 100% rename from ext-network.yml rename to ext-network.yml.sample