From f3bf6627955aab25d3137d295575ff9b90f448b0 Mon Sep 17 00:00:00 2001 From: "Rick Farina (Zero_Chaos)" Date: Thu, 12 Dec 2019 10:27:59 -0500 Subject: [PATCH 1/2] wait_for_link don't blindly execute the payload, wait for a link first at least --- usr/bin/LED | 4 ++++ usr/bin/shark_framework | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/usr/bin/LED b/usr/bin/LED index b20a51a..0c54d21 100755 --- a/usr/bin/LED +++ b/usr/bin/LED @@ -88,6 +88,10 @@ function parse_state() { } case $1 in + "LINKSETUP") + parse_color "M" + parse_pattern "SLOW" + ;; "SETUP") parse_color "M" parse_pattern "SOLID" diff --git a/usr/bin/shark_framework b/usr/bin/shark_framework index 33ed895..9648f23 100755 --- a/usr/bin/shark_framework +++ b/usr/bin/shark_framework @@ -98,6 +98,14 @@ function execute_upgrade() { } } +function wait_for_link() { + LED LINKSETUP + while mii-tool eth0 | grep -q 'eth0: no link'; do + sleep 1 + done + LED SETUP +} + function execute_payload() { $LOG "Executing PAYLOAD" @@ -155,6 +163,7 @@ function enter_attack_mode() { stop_http stop_ssh + wait_for_link execute_payload enter_idle_mode From a852ea7c4ea266cb79dfcc3c72d66895b9dd4abf Mon Sep 17 00:00:00 2001 From: "Rick Farina (Zero_Chaos)" Date: Thu, 12 Dec 2019 11:43:27 -0500 Subject: [PATCH 2/2] fix indent for my master, foxtrot --- usr/bin/shark_framework | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr/bin/shark_framework b/usr/bin/shark_framework index 9648f23..85f7f65 100755 --- a/usr/bin/shark_framework +++ b/usr/bin/shark_framework @@ -99,11 +99,11 @@ function execute_upgrade() { } function wait_for_link() { - LED LINKSETUP - while mii-tool eth0 | grep -q 'eth0: no link'; do - sleep 1 - done - LED SETUP + LED LINKSETUP + while mii-tool eth0 | grep -q 'eth0: no link'; do + sleep 1 + done + LED SETUP } function execute_payload() {