Merge pull request #2 from ZeroChaos-/wait_for_link

wait_for_link
pull/5/head
Marc 2019-12-12 16:45:16 +00:00 committed by GitHub
commit f03627b8cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -88,6 +88,10 @@ function parse_state() {
}
case $1 in
"LINKSETUP")
parse_color "M"
parse_pattern "SLOW"
;;
"SETUP")
parse_color "M"
parse_pattern "SOLID"

View File

@ -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