Fix sharkjack.sh

Fix shark jack interface not getting detected. Grepping the ip and invert grepping (grep -v) the same ip cannot return anything (unless -A is set to greater than 1), thus $IFACE is always empty.
pull/3/head
Ruben Mosblech 2019-09-15 13:09:40 +02:00 committed by GitHub
parent 2b547122f2
commit 5742bbe2cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ function locate_interface_to_shark() {
printf "\n%s" 'Waiting for a Shark Jack to be connected..' printf "\n%s" 'Waiting for a Shark Jack to be connected..'
while [[ -z $IFACE ]]; do while [[ -z $IFACE ]]; do
printf "%s" . printf "%s" .
IFACE=$(ip route show to match 172.16.24.1 2>/dev/null| grep -i 172.16.24.1 | cut -d ' ' -f3 | grep -v 172.16.24.1) IFACE=$(ip route show to match 172.16.24.1 2>/dev/null| grep -i 172.16.24.1 | cut -d ' ' -f3)
sleep 1 sleep 1
done done
echo -e "\n" echo -e "\n"