Tim commited on
Commit
29d46ae
Β·
verified Β·
1 Parent(s): 2a2e7b4

Upload diagnostic.sh

Browse files
Files changed (1) hide show
  1. diagnostic.sh +190 -0
diagnostic.sh ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # BSKL AIColorMatch Diagnostic Script
3
+ # Collects system info and logs for troubleshooting
4
+
5
+ OUTPUT_DIR="$HOME/Desktop/BSKL_Diagnostic_$(date +%Y%m%d_%H%M%S)"
6
+ mkdir -p "$OUTPUT_DIR"
7
+
8
+ echo "=== BSKL AIColorMatch Diagnostic Tool ===" | tee "$OUTPUT_DIR/diagnostic.txt"
9
+ echo "Date: $(date)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
10
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
11
+
12
+ # 1. macOS Version
13
+ echo "=== macOS Version ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
14
+ sw_vers | tee -a "$OUTPUT_DIR/diagnostic.txt"
15
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
16
+
17
+ # 2. Mac Architecture
18
+ echo "=== Mac Architecture ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
19
+ uname -m | tee -a "$OUTPUT_DIR/diagnostic.txt"
20
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
21
+
22
+ # 3. Render Engine Version
23
+ echo "=== Render Engine Version ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
24
+ RE_VERSION_FILE="/Library/Application Support/BSKL/Render Engine/Python 3.10/version.txt"
25
+ if [ -f "$RE_VERSION_FILE" ]; then
26
+ echo "Version: $(cat "$RE_VERSION_FILE")" | tee -a "$OUTPUT_DIR/diagnostic.txt"
27
+ else
28
+ echo "❌ Render Engine not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
29
+ fi
30
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
31
+
32
+ # 4. AIM Server Process Status
33
+ echo "=== AIM Server Process ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
34
+ AIM_PROCESS=$(ps aux | grep -i "AI MACHINE Server" | grep -v grep)
35
+ if [ -n "$AIM_PROCESS" ]; then
36
+ echo "βœ… AIM Server is running" | tee -a "$OUTPUT_DIR/diagnostic.txt"
37
+ echo "$AIM_PROCESS" | tee -a "$OUTPUT_DIR/diagnostic.txt"
38
+ else
39
+ echo "❌ AIM Server is NOT running" | tee -a "$OUTPUT_DIR/diagnostic.txt"
40
+ fi
41
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
42
+
43
+ # 5. Check Server Port (7007 is default)
44
+ echo "=== Server Port (7007) ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
45
+ PORT_CHECK=$(lsof -i :7007 2>/dev/null | head -5)
46
+ if [ -n "$PORT_CHECK" ]; then
47
+ echo "βœ… Port 7007 is in use:" | tee -a "$OUTPUT_DIR/diagnostic.txt"
48
+ echo "$PORT_CHECK" | tee -a "$OUTPUT_DIR/diagnostic.txt"
49
+ else
50
+ echo "❌ Port 7007 is not in use (server not running?)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
51
+ fi
52
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
53
+
54
+ # 6. AIM Server Lock File
55
+ echo "=== AIM Server Lock File ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
56
+ LOCK_FILE="$HOME/.AI MACHINE Server.lock"
57
+ if [ -f "$LOCK_FILE" ]; then
58
+ echo "Lock file exists: $LOCK_FILE" | tee -a "$OUTPUT_DIR/diagnostic.txt"
59
+ else
60
+ echo "No lock file found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
61
+ fi
62
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
63
+
64
+ # 7. AIM Settings
65
+ echo "=== AIM Settings ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
66
+ SETTINGS_FILE="$HOME/.aim/settings.json"
67
+ if [ -f "$SETTINGS_FILE" ]; then
68
+ echo "Settings file:" | tee -a "$OUTPUT_DIR/diagnostic.txt"
69
+ cat "$SETTINGS_FILE" | tee -a "$OUTPUT_DIR/diagnostic.txt"
70
+ cp "$SETTINGS_FILE" "$OUTPUT_DIR/"
71
+ else
72
+ echo "No settings file found at $SETTINGS_FILE" | tee -a "$OUTPUT_DIR/diagnostic.txt"
73
+ fi
74
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
75
+
76
+ # 8. AIM Server Files
77
+ echo "=== AIM Server Files ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
78
+ AIM_SERVER_DIR="/Library/Application Support/BSKL/AI MACHINE/Server"
79
+ if [ -d "$AIM_SERVER_DIR" ]; then
80
+ ls -la "$AIM_SERVER_DIR"/*.so 2>/dev/null | tee -a "$OUTPUT_DIR/diagnostic.txt"
81
+ else
82
+ echo "❌ AIM Server directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
83
+ fi
84
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
85
+
86
+ # 9. AI MACHINE Plugins
87
+ echo "=== AI MACHINE Plugins ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
88
+ PLUGINS_DIR="/Library/Application Support/BSKL/AI MACHINE/Plugins"
89
+ if [ -d "$PLUGINS_DIR" ]; then
90
+ for plugin_dir in "$PLUGINS_DIR"/*/; do
91
+ if [ -d "$plugin_dir" ]; then
92
+ plugin_name=$(basename "$plugin_dir")
93
+ echo "Plugin: $plugin_name" | tee -a "$OUTPUT_DIR/diagnostic.txt"
94
+ # List .so files with sizes
95
+ for so_file in "$plugin_dir"*.so; do
96
+ if [ -f "$so_file" ]; then
97
+ size=$(ls -lh "$so_file" | awk '{print $5}')
98
+ arch=$(file "$so_file" | grep -o "arm64\|x86_64" | head -1)
99
+ echo " $(basename "$so_file") ($size, $arch)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
100
+ fi
101
+ done
102
+ fi
103
+ done
104
+ else
105
+ echo "❌ AI MACHINE Plugins directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
106
+ fi
107
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
108
+
109
+ # 10. Adobe BSKL Plugins (with version info from plist)
110
+ echo "=== Adobe BSKL Plugins ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
111
+ ADOBE_PLUGINS_DIR="/Library/Application Support/Adobe/Common/Plug-ins/7.0/MediaCore/BSKL"
112
+ if [ -d "$ADOBE_PLUGINS_DIR" ]; then
113
+ for plugin in "$ADOBE_PLUGINS_DIR"/*.plugin; do
114
+ if [ -d "$plugin" ]; then
115
+ plugin_name=$(basename "$plugin" .plugin)
116
+ plist="$plugin/Contents/Info.plist"
117
+ if [ -f "$plist" ]; then
118
+ version=$(defaults read "$plist" CFBundleShortVersionString 2>/dev/null || echo "n/a")
119
+ build=$(defaults read "$plist" CFBundleVersion 2>/dev/null || echo "n/a")
120
+ sdk=$(defaults read "$plist" DTPlatformVersion 2>/dev/null || echo "n/a")
121
+ xcode=$(defaults read "$plist" DTXcode 2>/dev/null || echo "n/a")
122
+ echo "Plugin: $plugin_name" | tee -a "$OUTPUT_DIR/diagnostic.txt"
123
+ echo " Version: $version (build: $build)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
124
+ echo " SDK: macOS $sdk, Xcode: $xcode" | tee -a "$OUTPUT_DIR/diagnostic.txt"
125
+ else
126
+ echo "Plugin: $plugin_name (no plist)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
127
+ fi
128
+ fi
129
+ done
130
+ else
131
+ echo "❌ Adobe BSKL plugins directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
132
+ fi
133
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
134
+
135
+ # 11. NumPy Architecture
136
+ echo "=== NumPy Architecture ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
137
+ NUMPY_FILE="/Library/Application Support/BSKL/Render Engine/Python 3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-darwin.so"
138
+ if [ -f "$NUMPY_FILE" ]; then
139
+ arch=$(file "$NUMPY_FILE" | grep -o "arm64\|x86_64" | head -1)
140
+ echo "NumPy architecture: $arch" | tee -a "$OUTPUT_DIR/diagnostic.txt"
141
+ else
142
+ echo "❌ NumPy not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
143
+ fi
144
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
145
+
146
+ # 12. Test Server Connection
147
+ echo "=== Server Connection Test ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
148
+ CURL_RESULT=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 3 http://127.0.0.1:7007/ 2>/dev/null)
149
+ if [ "$CURL_RESULT" = "200" ] || [ "$CURL_RESULT" = "404" ] || [ "$CURL_RESULT" = "422" ]; then
150
+ echo "βœ… Server responding (HTTP $CURL_RESULT)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
151
+ else
152
+ echo "❌ Server not responding (HTTP $CURL_RESULT)" | tee -a "$OUTPUT_DIR/diagnostic.txt"
153
+ fi
154
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
155
+
156
+ # 13. Collect Logs
157
+ echo "=== Collecting Logs ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
158
+
159
+ # BSKL logs directory
160
+ BSKL_LOGS="/Library/Application Support/BSKL/Logs"
161
+ if [ -d "$BSKL_LOGS" ]; then
162
+ echo "Found logs:" | tee -a "$OUTPUT_DIR/diagnostic.txt"
163
+ ls -la "$BSKL_LOGS"/*.log 2>/dev/null | tee -a "$OUTPUT_DIR/diagnostic.txt"
164
+ cp "$BSKL_LOGS"/*.log "$OUTPUT_DIR/" 2>/dev/null
165
+ echo "βœ… Copied BSKL logs" | tee -a "$OUTPUT_DIR/diagnostic.txt"
166
+ else
167
+ echo "❌ BSKL logs directory not found" | tee -a "$OUTPUT_DIR/diagnostic.txt"
168
+ fi
169
+
170
+ # 14. Create ZIP archive
171
+ echo "" | tee -a "$OUTPUT_DIR/diagnostic.txt"
172
+ echo "=== Creating ZIP Archive ===" | tee -a "$OUTPUT_DIR/diagnostic.txt"
173
+
174
+ ZIP_FILE="$HOME/Desktop/BSKL_Diagnostic_$(date +%Y%m%d_%H%M%S).zip"
175
+ cd "$HOME/Desktop"
176
+ zip -r "$ZIP_FILE" "$(basename $OUTPUT_DIR)" > /dev/null 2>&1
177
+
178
+ if [ -f "$ZIP_FILE" ]; then
179
+ # Cleanup temp folder
180
+ rm -rf "$OUTPUT_DIR"
181
+
182
+ echo ""
183
+ echo "=========================================="
184
+ echo "βœ… Done! Please send this file to support:"
185
+ echo "$ZIP_FILE"
186
+ echo "=========================================="
187
+ else
188
+ echo "❌ Failed to create ZIP archive" | tee -a "$OUTPUT_DIR/diagnostic.txt"
189
+ echo "Diagnostic folder: $OUTPUT_DIR"
190
+ fi