From 5b03d97368d1fe65d5ce02ed9a9a88d4d7938262 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Wed, 23 Oct 2019 15:26:53 +0200 Subject: [PATCH] fix: fixes a race condition in the launcher scripts and enables MANU if eth0 is up (closes #365) --- builder/pwnagotchi.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index a9fb322cf..b4c9680a9 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -304,7 +304,7 @@ # blink 10 times to signal ready state /usr/bin/bootblink 10 & # start a detached screen session with bettercap - if ifconfig | grep usb0 | grep RUNNING; then + if [[ ifconfig | grep usb0 | grep RUNNING ]] || [[ $(cat /sys/class/net/eth0/carrier) ]]; then # if override file exists, go into auto mode if [ -f /root/.pwnagotchi-auto ]; then rm /root/.pwnagotchi-auto @@ -322,13 +322,10 @@ mode: 0755 content: | #!/usr/bin/env bash - # blink 10 times to signal ready state - /usr/bin/bootblink 10 & /usr/bin/monstart - if ifconfig | grep usb0 | grep RUNNING; then + if [[ ifconfig | grep usb0 | grep RUNNING ]] || [[ $(cat /sys/class/net/eth0/carrier) ]]; then # if override file exists, go into auto mode if [ -f /root/.pwnagotchi-auto ]; then - rm /root/.pwnagotchi-auto /usr/bin/bettercap -no-colors -caplet pwnagotchi-auto -iface mon0 else /usr/bin/bettercap -no-colors -caplet pwnagotchi-manual -iface mon0