feat: implement server-wide management actions and enhance TUI dashboard
This commit is contained in:
@@ -55,11 +55,14 @@ case "$CMD" in
|
||||
|
||||
killed=0
|
||||
for id in "${agents[@]}"; do
|
||||
pid="$(read_pid "$id")"
|
||||
if [[ "$pid" -gt 0 ]] && kill -0 "$pid" 2>/dev/null; then
|
||||
kill -9 "$pid" 2>/dev/null || true
|
||||
all_pids="$(find_agent_pids "$id")"
|
||||
if [[ -n "$all_pids" ]]; then
|
||||
cnt="$(echo "$all_pids" | wc -l)"
|
||||
for p in $all_pids; do
|
||||
kill -9 "$p" 2>/dev/null || true
|
||||
done
|
||||
rm -f "$(pid_file "$id")"
|
||||
ok "$id killed (PID $pid)"
|
||||
ok "$id killed ($cnt instance(s), PIDs: $(echo $all_pids | tr '\n' ' '))"
|
||||
((killed++)) || true
|
||||
else
|
||||
dim " $id (no estaba corriendo)"
|
||||
|
||||
Reference in New Issue
Block a user