diff --git a/scripts/recover-orphaned-processes.sh b/scripts/recover-orphaned-processes.sh index 65bf55ef5fb..a6b26e8640f 100755 --- a/scripts/recover-orphaned-processes.sh +++ b/scripts/recover-orphaned-processes.sh @@ -30,7 +30,10 @@ if [ "$#" -gt 0 ]; then fi if ! command -v node &>/dev/null; then - echo '{"error":"node not found on PATH","orphaned":[],"ts":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'"}' + _ts="unknown" + command -v date &>/dev/null && _ts="$(date -u +%Y-%m-%dT%H:%M:%SZ 2>/dev/null)" || true + [ -z "$_ts" ] && _ts="unknown" + printf '{"error":"node not found on PATH","orphaned":[],"ts":"%s"}\n' "$_ts" exit 0 fi