From 8a247e942a9ed3810f456acdaf9387ab7f154176 Mon Sep 17 00:00:00 2001 From: v1s1t0r1sh3r3 Date: Wed, 22 Jun 2022 23:44:50 +0200 Subject: [PATCH] Fix error shown in very weird situations when the airodump file is not created for whatever reason --- airgeddon.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/airgeddon.sh b/airgeddon.sh index c50f996bd..b3f0c54e1 100755 --- a/airgeddon.sh +++ b/airgeddon.sh @@ -12639,11 +12639,10 @@ function explore_for_targets_option() { recalculate_windows_sizes manage_output "+j -bg \"#000000\" -fg \"#FFFFFF\" -geometry ${g1_topright_window} -T \"Exploring for targets\"" "airodump-ng -w ${tmpdir}nws${cypher_cmd}${interface} --band ${airodump_band_modifier}" "Exploring for targets" "active" wait_for_process "airodump-ng -w ${tmpdir}nws${cypher_cmd}${interface} --band ${airodump_band_modifier}" "Exploring for targets" - targetline=$(awk '/(^Station[s]?|^Client[es]?)/{print NR}' < "${tmpdir}nws-01.csv") + targetline=$(awk '/(^Station[s]?|^Client[es]?)/{print NR}' "${tmpdir}nws-01.csv" 2> /dev/null) targetline=$((targetline - 1)) - - head -n "${targetline}" "${tmpdir}nws-01.csv" &> "${tmpdir}nws.csv" - tail -n +"${targetline}" "${tmpdir}nws-01.csv" &> "${tmpdir}clts.csv" + head -n "${targetline}" "${tmpdir}nws-01.csv" 2> /dev/null &> "${tmpdir}nws.csv" + tail -n +"${targetline}" "${tmpdir}nws-01.csv" 2> /dev/null &> "${tmpdir}clts.csv" csvline=$(wc -l "${tmpdir}nws.csv" 2> /dev/null | awk '{print $1}') if [ "${csvline}" -le 3 ]; then