-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfire-run.sh
More file actions
executable file
·53 lines (42 loc) · 2.24 KB
/
Copy pathfire-run.sh
File metadata and controls
executable file
·53 lines (42 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# /*******************************************************************************
# * TYPE: SERVICE | CLASS: RUN-ENGINE | NAME: fire-run.sh
# * IDENTITY: JOE TRON // VERSION 3.1 // HEADER_FIXED // HAHA!
# * ROLE: Execute .exe binaries as background services with persistent logging.
# *******************************************************************************/
VAULT_JSON="fire-gem/artifacts/json/asm/"
echo "[AVIS] RUN_SERVICE: Engaging Background Execution Vectors..."
# 1. SCAN ASM VAULT FOR RUN COMMANDS
# Using -type f to avoid directory collisions
for target_json in $(find "$VAULT_JSON" -type f -name "*.json" 2>/dev/null); do
echo "RUN: Parsing $target_json for Execution Targets..."
# Extract files marked as RUN or defined as TARGET binaries
# Added || echo "" to prevent jq from crashing on malformed JSON
RUN_FILES=$(jq -r '.AVIS_COMM_OBJECT.FLOW_SCOPE[] | select(.TYPE=="RUN") | .FILE' "$target_json" 2>/dev/null || echo "")
for bin in $RUN_FILES; do
# Cleanup: ignore null or empty results from jq
[ -z "$bin" ] || [ "$bin" == "null" ] && continue
# Support for both raw names and .exe extensions
EXEC_TARGET=""
if [ -f "./$bin" ]; then EXEC_TARGET="./$bin"
elif [ -f "./${bin}.exe" ]; then EXEC_TARGET="./${bin}.exe"
elif [ -f "./${bin}_bin" ]; then EXEC_TARGET="./${bin}_bin"
fi
if [ -n "$EXEC_TARGET" ]; then
echo "SIGNAL: wm_macro_rack - Dispatching Service: $EXEC_TARGET"
# 2. EXECUTE AS BACKGROUND SERVICE (&)
# Ensure it is executable and run with nohup to survive shell exit
chmod +x "$EXEC_TARGET"
LOG_FILE="fire-run-$(basename "$EXEC_TARGET").log"
# Use nohup to ensure the process persists after the Action finishes
nohup "$EXEC_TARGET" > "$LOG_FILE" 2>&1 &
PID=$!
echo "BASH: [ACK] THREAD_START: $EXEC_TARGET seated at PID: $PID"
echo "BASH: [LOG] Persistent output directed to $LOG_FILE"
else
echo "BASH: [NACK] RUN_ERROR: Target $bin NOT FOUND in root."
fi
done
done
echo "FIRE-RUN: All services dispatched to background. wm_macro_ack."
exit 0