Skip to content

Commit

Permalink
scripts/airmon-ng.linux: whoops, thanks
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroChaos- committed Nov 30, 2021
1 parent 6124f82 commit f14142c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/airmon-ng.linux
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,16 @@ handleLostPhys

listInterfaces

# Kernel version checks are used unconditionally so just set it during main
KV="$(uname -r | awk -F'-' '{print $1}')"
KVMAJOR="$(printf "%s" "${KV}" | awk -F'.' '{print $1$2}')"
KVMINOR="$(printf "%s" "${KV}" | awk -F'.' '{print $3}')"
if [ "${KVMINOR}" = "0" ]; then
# debian and kids always have 0 in minor for uname -r
KV="$(uname -v | awk '{sub(/-.*/, "", $4); print $4}')"
KVMINOR="$(printf "%s" "${KV}" | awk -F'.' '{print $3}')"
fi

if [ "${1}" = "check" ] || [ "${1}" = "start" ]; then
if [ "${VERBOSE}" = "0" ]; then
# if verbose is set this was already run
Expand Down Expand Up @@ -1434,16 +1444,6 @@ if [ "$DEBUG" = "1" ]; then
fi
fi

# Kernel version checks are used unconditionally so just set it during main
KV="$(uname -r | awk -F'-' '{print $1}')"
KVMAJOR="$(printf "%s" "${KV}" | awk -F'.' '{print $1$2}')"
KVMINOR="$(printf "%s" "${KV}" | awk -F'.' '{print $3}')"
if [ "${KVMINOR}" = "0" ]; then
# debian and kids always have 0 in minor for uname -r
KV="$(uname -v | awk '{sub(/-.*/, "", $4); print $4}')"
KVMINOR="$(printf "%s" "${KV}" | awk -F'.' '{print $3}')"
fi

if [ "$VERBOSE" = "1" ]; then
if [ -n "$(command -v lsb_release 2> /dev/null)" ]; then
lsb_release -a | grep -iv 'n/a'
Expand Down

0 comments on commit f14142c

Please sign in to comment.