Files
jarvis-home/scripts/doctor.sh
2026-08-29 17:02:35 +02:00

72 lines
2.7 KiB
Bash

#!/usr/bin/env sh
set -u
ok(){ printf '[OK] %s\n' "$*"; }
warn(){ printf '[!!] %s\n' "$*"; }
check_bin(){
label="$1"; bin="$2"
if command -v "$bin" >/dev/null 2>&1; then
resolved="$(command -v "$bin")"
ok "$label binary: $resolved"
ls -l "$resolved" 2>/dev/null || true
elif [ -x "$bin" ]; then
ok "$label binary: $bin"
ls -l "$bin" 2>/dev/null || true
else
warn "$label binary fehlt/nicht ausführbar: $bin"
fi
}
check_file(){
label="$1"; f="$2"
if [ -f "$f" ]; then
ok "$label: $f ($(wc -c < "$f" 2>/dev/null || echo '?') bytes)"
else
warn "$label fehlt: $f"
fi
}
printf '%s\n' '--- JARVIS Voice Doctor ---'
check_bin "FFmpeg" "${VOICE_FFMPEG_BIN:-ffmpeg}"
check_bin "Whisper" "${VOICE_WHISPER_BIN:-/usr/local/bin/whisper-cli}"
check_file "Whisper model" "${VOICE_WHISPER_MODEL:-/models/ggml-small.bin}"
check_bin "Piper" "${VOICE_PIPER_BIN:-/tools/piper}"
check_file "Piper model" "${VOICE_PIPER_MODEL:-/models/de_DE-thorsten-medium.onnx}"
check_file "Piper model config" "${VOICE_PIPER_MODEL:-/models/de_DE-thorsten-medium.onnx}.json"
printf 'LD_LIBRARY_PATH=%s\n' "${LD_LIBRARY_PATH:-}"
printf 'PATH=%s\n' "$PATH"
printf '%s\n' '--- JARVIS Skill Doctor ---'
skills_dir="${JARVIS_SKILLS_DIR:-./skills}"
if [ -d "$skills_dir" ]; then
ok "Skill directory: $skills_dir"
find "$skills_dir" -mindepth 2 -maxdepth 2 -name skill.json -print 2>/dev/null | while IFS= read -r manifest; do
printf ' - %s\n' "$manifest"
done
else
warn "Skill directory fehlt: $skills_dir"
fi
printf 'JARVIS_SKILLS_ENABLED=%s\n' "${JARVIS_SKILLS_ENABLED:-true}"
printf 'JARVIS_SKILL_PROCESS_ENABLED=%s\n' "${JARVIS_SKILL_PROCESS_ENABLED:-true}"
printf 'JARVIS_SKILL_ALLOW_SYSTEM_EXEC=%s\n' "${JARVIS_SKILL_ALLOW_SYSTEM_EXEC:-false}"
printf '%s\n' '--- JARVIS Skill Mesh Doctor ---'
printf 'JARVIS_MESH_ENABLED=%s\n' "${JARVIS_MESH_ENABLED:-true}"
if [ -n "${JARVIS_MESH_ENROLLMENT_TOKEN:-}" ]; then
ok "Mesh enrollment token: configured (value hidden)"
else
warn "Mesh enrollment token not configured"
fi
printf 'JARVIS_MESH_LEASE_SECONDS=%s\n' "${JARVIS_MESH_LEASE_SECONDS:-30}"
printf 'JARVIS_MESH_INVOKE_TIMEOUT_MS=%s\n' "${JARVIS_MESH_INVOKE_TIMEOUT_MS:-30000}"
printf 'JARVIS_DOCKER_CONTROLLER_ENABLED=%s\n' "${JARVIS_DOCKER_CONTROLLER_ENABLED:-false}"
docker_sock="${JARVIS_DOCKER_SOCKET:-/var/run/docker.sock}"
if [ -S "$docker_sock" ]; then
ok "Docker socket: $docker_sock"
elif [ "${JARVIS_DOCKER_CONTROLLER_ENABLED:-false}" = "true" ]; then
warn "Docker controller enabled but socket missing: $docker_sock"
else
printf 'Docker socket: %s (not required while controller is disabled)\n' "$docker_sock"
fi
printf 'Docker skill label=%s=%s\n' "${JARVIS_DOCKER_SKILL_LABEL:-com.jarvis.skill-service}" "${JARVIS_DOCKER_SKILL_LABEL_VALUE:-true}"