From 7029eeb5c50e6b542c6f1617232e5e3043e0d751 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 10 Apr 2026 09:11:20 +0200 Subject: [PATCH] fix(homarr): make Redis bind directive idempotent Replace unconditional append with grep guard to prevent duplicate 'bind 127.0.0.1 -::1' entries on repeated updates. --- ct/homarr.sh | 2 +- install/homarr-install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/homarr.sh b/ct/homarr.sh index a4fc6d58f..1af49547d 100644 --- a/ct/homarr.sh +++ b/ct/homarr.sh @@ -65,7 +65,7 @@ EOF msg_info "Updating Homarr" cp /opt/homarr/redis.conf /etc/redis/redis.conf - echo "bind 127.0.0.1 -::1" >> /etc/redis/redis.conf + grep -q '^bind 127.0.0.1 -::1$' /etc/redis/redis.conf || echo "bind 127.0.0.1 -::1" >> /etc/redis/redis.conf rm /etc/nginx/nginx.conf cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf msg_ok "Updated Homarr" diff --git a/install/homarr-install.sh b/install/homarr-install.sh index ff090234c..6443495f7 100644 --- a/install/homarr-install.sh +++ b/install/homarr-install.sh @@ -47,7 +47,7 @@ mkdir -p /appdata/redis chown -R redis:redis /appdata/redis chmod 744 /appdata/redis cp /opt/homarr/redis.conf /etc/redis/redis.conf -echo "bind 127.0.0.1 -::1" >> /etc/redis/redis.conf +grep -q '^bind 127.0.0.1 -::1$' /etc/redis/redis.conf || echo "bind 127.0.0.1 -::1" >> /etc/redis/redis.conf rm /etc/nginx/nginx.conf mkdir -p /etc/nginx/templates cp /opt/homarr/nginx.conf /etc/nginx/templates/nginx.conf