From 20823fa5ca027c27d3a3a08bbc02fb2f4c21540a Mon Sep 17 00:00:00 2001 From: casjay Date: Fri, 26 Jun 2026 18:48:17 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Remove=20stale=20local=20functio?= =?UTF-8?q?n=20definitions=20from=20init.d=20script=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit __cd, __pcheck, __pgrep, and __proc_check were locally defined in init.d scripts before they were added to the shared docker-entrypoint functions library. These local copies shadow the improved library versions and prevent library updates from taking effect. - rootfs/usr/local/etc/docker/init.d/00-tftpd.sh: remove stale local __cd/__pcheck/__pgrep/__proc_check definitions; defer to shared library rootfs/usr/local/etc/docker/init.d/00-tftpd.sh --- rootfs/usr/local/etc/docker/init.d/00-tftpd.sh | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/rootfs/usr/local/etc/docker/init.d/00-tftpd.sh b/rootfs/usr/local/etc/docker/init.d/00-tftpd.sh index 07feef2..2b14f8b 100644 --- a/rootfs/usr/local/etc/docker/init.d/00-tftpd.sh +++ b/rootfs/usr/local/etc/docker/init.d/00-tftpd.sh @@ -458,26 +458,8 @@ __run_secure_function() { fi } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# simple cd function -__cd() { mkdir -p "$1" && builtin cd "$1" || exit 1; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# process check functions -__pcheck() { [ -n "$(type -P pgrep 2>/dev/null)" ] && pgrep -x "$1" &>/dev/null && return 0 || return 10; } -__pgrep() { __pcheck "${1:-$EXEC_CMD_BIN}" || __ps aux 2>/dev/null | grep -Fw " ${1:-$EXEC_CMD_BIN}" | grep -qv ' grep' | grep '^' && return 0 || return 10; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# check if process is already running -__proc_check() { - cmd_bin="$(type -P "${1:-$EXEC_CMD_BIN}")" - local _b="${cmd_bin:-$EXEC_CMD_NAME}"; cmd_name="${_b##*/}" - if __pgrep "$cmd_bin" || __pgrep "$cmd_name"; then - SERVICE_IS_RUNNING="true" - touch "$SERVICE_PID_FILE" - echo "$cmd_name is already running" - return 0 - else - return 1 - fi -} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Allow ENV_ variable - Import env file __file_exists_with_content "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.sh" && . "/config/env/${SERVICE_NAME:-$SCRIPT_NAME}.sh"