fix: fixed, refactored and centralized launchers logic (closes #473)

This commit is contained in:
Simone Margaritelli
2019-10-31 14:14:13 +01:00
parent 96c617e152
commit 13064879e0
7 changed files with 77 additions and 40 deletions

View File

@ -1,16 +1,11 @@
#!/usr/bin/env bash
# blink 10 times to signal ready state
/usr/bin/bootblink 10 &
source /usr/bin/pwnlib
# if usb0 or eth0 are up
if [[ $(ifconfig | grep usb0 | grep RUNNING) ]] || [[ !$(grep '1' /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/local/bin/pwnagotchi
else
/usr/local/bin/pwnagotchi --manual
fi
else
# blink 10 times to signal ready state
blink_led 10 &
if is_auto_mode; then
/usr/local/bin/pwnagotchi
else
/usr/local/bin/pwnagotchi --manual
fi