bin: Add SERIAL_WRITE output for link waiting and payload execution

fix_package_url
Marc 2021-08-23 19:30:14 +01:00
parent fece2024ae
commit 5e3b4e3928
No known key found for this signature in database
GPG Key ID: 0657563F705ACAAE
1 changed files with 4 additions and 2 deletions

View File

@ -4,11 +4,12 @@ LOG="logger -t Shark [*]"
$LOG "Prepping PAYLOAD environment" $LOG "Prepping PAYLOAD environment"
if [ ! -d /root/loot ]; then if [ ! -d /root/loot ]; then
mkdir -p /root/loot; mkdir -p /root/loot;
fi fi
wait_for_link() { wait_for_link() {
LED SETUP LED SETUP
SERIAL_WRTIE "[*] Waiting for Ethernet link to come up..."
until swconfig dev switch0 port 0 get link | grep -q 'link:up'; do until swconfig dev switch0 port 0 get link | grep -q 'link:up'; do
sleep 1 sleep 1
done done
@ -16,6 +17,7 @@ wait_for_link() {
} }
wait_for_no_link() { wait_for_no_link() {
LED LINKSETUP LED LINKSETUP
SERIAL_WRITE "[*] Waiting for Ethernet link to go down..."
until swconfig dev switch0 port 0 get link | grep -q 'link:down'; do until swconfig dev switch0 port 0 get link | grep -q 'link:down'; do
sleep 1 sleep 1
done done
@ -37,7 +39,7 @@ fi
wait_for_link wait_for_link
$LOG "Running requested PAYLOAD" SERIAL_WRITE "[*] Starting Payload"
case $(basename "${payload}") in case $(basename "${payload}") in
"payload.py") "payload.py")
python "${payload}" > /dev/null 2>&1 python "${payload}" > /dev/null 2>&1