From 2fc39e313805d47370ca6a38747e24df4791ea2b Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 4 Sep 2023 00:33:07 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/functions/entrypoint.sh --- rootfs/usr/local/etc/docker/functions/entrypoint.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index a89930a..8f93ebd 100755 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -266,20 +266,13 @@ __cron() { __replace() { local search="$1" replace="$2" file="${3:-$2}" [ -e "$file" ] || return 1 - grep -s -qR -- "$search" "$file" &>/dev/null && __sed "$search" "$replace" "$file" || return 0 - grep -s -qR -- "$replace" "$file" && printf '%s\n' "Changed $search to $replace in $file" && return 0 || { - printf '%s\n' "Failed to change $search in $file" >&2 && return 2 - } + __sed "$search" "$replace" "$file" || return 0 } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __find_replace() { local search="$1" replace="$2" file="${3:-$2}" [ -e "$file" ] || return 1 - grep -s -qR -- "$search" "$file" &>/dev/null || return 0 find "$file" -type f -not -path '.git*' -exec sed -i "s|$search|$replace|g" {} \; - grep -s -qR -- "$replace" "$file" && printf '%s\n' "Changed $search to $replace in $file" && return 0 || { - printf '%s\n' "Failed to change $search in $file" >&2 && return 2 - } } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # /config > /etc