plugins / diagnostic.sh
Tim's picture
Upload diagnostic.sh
29d46ae verified
raw
history blame
8.15 kB
#!/bin/bash
# BSKL AIColorMatch Diagnostic Script
# Collects system info and logs for troubleshooting
OUTPUT_DIR="$HOME/Desktop/BSKL_Diagnostic_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$OUTPUT_DIR"
echo "=== BSKL AIColorMatch Diagnostic Tool ===" | tee "$OUTPUT_DIR/diagnostic.txt"
echo "Date: $(date)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 1. macOS Version
echo "=== macOS Version ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
sw_vers | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 2. Mac Architecture
echo "=== Mac Architecture ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
uname -m | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 3. Render Engine Version
echo "=== Render Engine Version ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
RE_VERSION_FILE="/Library/Application Support/BSKL/Render Engine/Python 3.10/version.txt"
if [ -f "$RE_VERSION_FILE" ]; then
echo "Version: $(cat "$RE_VERSION_FILE")" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "❌ Render Engine not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 4. AIM Server Process Status
echo "=== AIM Server Process ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
AIM_PROCESS=$(ps aux | grep -i "AI MACHINE Server" | grep -v grep)
if [ -n "$AIM_PROCESS" ]; then
echo "βœ… AIM Server is running" | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo "$AIM_PROCESS" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "❌ AIM Server is NOT running" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 5. Check Server Port (7007 is default)
echo "=== Server Port (7007) ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
PORT_CHECK=$(lsof -i :7007 2>/dev/null | head -5)
if [ -n "$PORT_CHECK" ]; then
echo "βœ… Port 7007 is in use:" | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo "$PORT_CHECK" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "❌ Port 7007 is not in use (server not running?)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 6. AIM Server Lock File
echo "=== AIM Server Lock File ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
LOCK_FILE="$HOME/.AI MACHINE Server.lock"
if [ -f "$LOCK_FILE" ]; then
echo "Lock file exists: $LOCK_FILE" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "No lock file found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 7. AIM Settings
echo "=== AIM Settings ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
SETTINGS_FILE="$HOME/.aim/settings.json"
if [ -f "$SETTINGS_FILE" ]; then
echo "Settings file:" | tee -a "$OUTPUT_DIR/diagnostic.txt"
cat "$SETTINGS_FILE" | tee -a "$OUTPUT_DIR/diagnostic.txt"
cp "$SETTINGS_FILE" "$OUTPUT_DIR/"
else
echo "No settings file found at $SETTINGS_FILE" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 8. AIM Server Files
echo "=== AIM Server Files ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
AIM_SERVER_DIR="/Library/Application Support/BSKL/AI MACHINE/Server"
if [ -d "$AIM_SERVER_DIR" ]; then
ls -la "$AIM_SERVER_DIR"/*.so 2>/dev/null | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "❌ AIM Server directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 9. AI MACHINE Plugins
echo "=== AI MACHINE Plugins ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
PLUGINS_DIR="/Library/Application Support/BSKL/AI MACHINE/Plugins"
if [ -d "$PLUGINS_DIR" ]; then
for plugin_dir in "$PLUGINS_DIR"/*/; do
if [ -d "$plugin_dir" ]; then
plugin_name=$(basename "$plugin_dir")
echo "Plugin: $plugin_name" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# List .so files with sizes
for so_file in "$plugin_dir"*.so; do
if [ -f "$so_file" ]; then
size=$(ls -lh "$so_file" | awk '{print $5}')
arch=$(file "$so_file" | grep -o "arm64\|x86_64" | head -1)
echo " $(basename "$so_file") ($size, $arch)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
done
fi
done
else
echo "❌ AI MACHINE Plugins directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 10. Adobe BSKL Plugins (with version info from plist)
echo "=== Adobe BSKL Plugins ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
ADOBE_PLUGINS_DIR="/Library/Application Support/Adobe/Common/Plug-ins/7.0/MediaCore/BSKL"
if [ -d "$ADOBE_PLUGINS_DIR" ]; then
for plugin in "$ADOBE_PLUGINS_DIR"/*.plugin; do
if [ -d "$plugin" ]; then
plugin_name=$(basename "$plugin" .plugin)
plist="$plugin/Contents/Info.plist"
if [ -f "$plist" ]; then
version=$(defaults read "$plist" CFBundleShortVersionString 2>/dev/null || echo "n/a")
build=$(defaults read "$plist" CFBundleVersion 2>/dev/null || echo "n/a")
sdk=$(defaults read "$plist" DTPlatformVersion 2>/dev/null || echo "n/a")
xcode=$(defaults read "$plist" DTXcode 2>/dev/null || echo "n/a")
echo "Plugin: $plugin_name" | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo " Version: $version (build: $build)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo " SDK: macOS $sdk, Xcode: $xcode" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "Plugin: $plugin_name (no plist)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
fi
done
else
echo "❌ Adobe BSKL plugins directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 11. NumPy Architecture
echo "=== NumPy Architecture ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
NUMPY_FILE="/Library/Application Support/BSKL/Render Engine/Python 3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so"
if [ -f "$NUMPY_FILE" ]; then
arch=$(file "$NUMPY_FILE" | grep -o "arm64\|x86_64" | head -1)
echo "NumPy architecture: $arch" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "❌ NumPy not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 12. Test Server Connection
echo "=== Server Connection Test ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
CURL_RESULT=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 3 http://127.0.0.1:7007/ 2>/dev/null)
if [ "$CURL_RESULT" = "200" ] || [ "$CURL_RESULT" = "404" ] || [ "$CURL_RESULT" = "422" ]; then
echo "βœ… Server responding (HTTP $CURL_RESULT)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "❌ Server not responding (HTTP $CURL_RESULT)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# 13. Collect Logs
echo "=== Collecting Logs ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
# BSKL logs directory
BSKL_LOGS="/Library/Application Support/BSKL/Logs"
if [ -d "$BSKL_LOGS" ]; then
echo "Found logs:" | tee -a "$OUTPUT_DIR/diagnostic.txt"
ls -la "$BSKL_LOGS"/*.log 2>/dev/null | tee -a "$OUTPUT_DIR/diagnostic.txt"
cp "$BSKL_LOGS"/*.log "$OUTPUT_DIR/" 2>/dev/null
echo "βœ… Copied BSKL logs" | tee -a "$OUTPUT_DIR/diagnostic.txt"
else
echo "❌ BSKL logs directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
fi
# 14. Create ZIP archive
echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo "=== Creating ZIP Archive ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
ZIP_FILE="$HOME/Desktop/BSKL_Diagnostic_$(date +%Y%m%d_%H%M%S).zip"
cd "$HOME/Desktop"
zip -r "$ZIP_FILE" "$(basename $OUTPUT_DIR)" > /dev/null 2>&1
if [ -f "$ZIP_FILE" ]; then
# Cleanup temp folder
rm -rf "$OUTPUT_DIR"
echo ""
echo "=========================================="
echo "βœ… Done! Please send this file to support:"
echo "$ZIP_FILE"
echo "=========================================="
else
echo "❌ Failed to create ZIP archive" | tee -a "$OUTPUT_DIR/diagnostic.txt"
echo "Diagnostic folder: $OUTPUT_DIR"
fi