From 2d5f72ad409ff6553f8fbc716c28d2c9ebe1d0d2 Mon Sep 17 00:00:00 2001 From: Michael Haider Date: Wed, 19 Jun 2024 17:36:04 +0200 Subject: [PATCH] Fix check_autoboot_status to correctly identify and terminate autoboot_win.sh without including current SSH session process. Adjusted the check_autoboot_status function in long_press.sh to use pgrep with -af and grep -v 8424 to exclude the current process, ensuring accurate detection and termination of autoboot_win.sh on the remote device. Added output for terminated_successfully status to indicate script completion and readiness for subsequent actions. Fixes: #123 --- long_press.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/long_press.sh b/long_press.sh index 000ccc4..93a1274 100644 --- a/long_press.sh +++ b/long_press.sh @@ -27,9 +27,9 @@ duration=120 # Funktion, um Prozess auf dem Remote-Gerät zu überprüfen check_autoboot_status() { /usr/bin/ssh -i /root/.ssh/id_rsa root@192.168.178.80 ' - if pgrep -a autoboot_win.sh >/dev/null; then + if /usr/bin/pgrep -af "autoboot_win.sh" | grep -v $$; then echo "running" - pkill -f autoboot_win.sh + /usr/bin/pkill -f "autoboot_win.sh" else echo "not_running" fi @@ -64,6 +64,9 @@ while true; do sleep 5 done +# Status von "terminated_successfully" ausgeben +echo "### Variable 'terminated_successfully' ist $terminated_successfully ###" + # Wenn das Skript erfolgreich beendet wurde, Handshakes übertragen und cracking-Skript starten if [ "$terminated_successfully" = true ]; then echo "Übertrage Handshakes und starte crack_handshakes.sh"