From b414b24cad43ec860532c10b4f3f9c7338633af3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 10 Mar 2025 15:38:25 +0100 Subject: [PATCH] use yq --- install/npm-plus-install.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/install/npm-plus-install.sh b/install/npm-plus-install.sh index e03b87d..5d2e55d 100644 --- a/install/npm-plus-install.sh +++ b/install/npm-plus-install.sh @@ -14,12 +14,15 @@ network_check update_os msg_info "Installing Dependencies" -$STD apk add newt -$STD apk add curl -$STD apk add openssh -$STD apk add tzdata -$STD apk add nano -$STD apk add mc +$STD apk add \ + newt \ + curl \ + openssh \ + tzdata \ + nano \ + yq \ + mc + msg_ok "Installed Dependencies" msg_info "Installing Docker" @@ -48,8 +51,8 @@ msg_ok "Get NginxProxyManager Plus" read -r -p "Enter your TZ Timezone (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List): " TZ_INPUT read -r -p "Enter your ACME Email: " ACME_EMAIL_INPUT -sed -i "s|TZ=.*|TZ=\"$TZ_INPUT\"|g" /opt/compose.yaml -sed -i "s|ACME_EMAIL=.*|ACME_EMAIL=\"$ACME_EMAIL_INPUT\"|g" /opt/compose.yaml +yq eval "(.services.npmplus.environment |= map(select(. != \"TZ=*\"))) + [\"TZ=$TZ_INPUT\"]" -i /opt/compose.yaml +yq eval "(.services.npmplus.environment |= map(select(. != \"ACME_EMAIL=*\"))) + [\"ACME_EMAIL=$ACME_EMAIL_INPUT\"]" -i /opt/compose.yaml msg_info "Starting NPM Plus" docker compose up -d