From 1d7b83cdcc4d72134aa5de64587356c88d26e9f1 Mon Sep 17 00:00:00 2001 From: rsxchin <68041324+rsxchin@users.noreply.github.com> Date: Sun, 29 Jan 2023 18:19:26 -1000 Subject: [PATCH] Allow already connected Bunny No more need to disconnect and reconnect the bunny when using bunny-connecter.sh Also, it now looks for 00:11:22:33:44:55 instead of just 00:11:22 --- bunny-connecter.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bunny-connecter.sh b/bunny-connecter.sh index aebfe0a0..d6d6fd09 100755 --- a/bunny-connecter.sh +++ b/bunny-connecter.sh @@ -125,12 +125,6 @@ function manualsetup { } function guidedsetup { - bunnydetected=$(ip addr | grep '00:11:22' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en') - if [[ "$?" == 0 ]]; then - printf "\n Bash Bunny detected. Please disconnect the Bash Bunny from\n this computer and $(tput bold)press any key$(tput sgr0) to continue with guided setup.\n " - read -r -sn1 anykey - guidedsetup - fi hasiproute2=$(which ip) if [[ "$?" == 1 ]]; then printf "\n\n Configuration requires the 'iproute2' package (aka the 'ip' command).\n Please install 'iproute2' to continue.\n"; menu @@ -174,7 +168,7 @@ function guidedsetup { printf "\n $(tput setaf 3)Step 3 of 3: Select Bash Bunny Interface$(tput sgr0)\n Please connect the Bash Bunny to this computer.\n " a="0" - until bunnyiface=$(ip addr | grep '00:11:22' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en') + until bunnyiface=$(ip addr | grep '00:11:22:33:44:55' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en') do printf "." sleep 1 @@ -186,7 +180,7 @@ function guidedsetup { done printf "[Checking]" sleep 5 # Wait as the system is likely to rename interface. Sleeping rather than more advanced error handling becasue reasons. - bunnyiface=$(ip addr | grep '00:11:22' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en' | sed 's/://g') + bunnyiface=$(ip addr | grep '00:11:22:33:44:55' -B1 | awk {'print $2'} | head -1 | grep 'eth\|en' | sed 's/://g') printf "\n Detected Bash Bunny on interface $(tput bold)$bunnyiface$(tput sgr0)\n"; read -r -p " Use the above detected Bash Bunny interface? [Y/n]? " pi case $pi in