Path: blob/main/net-mgmt/aircrack-ng/files/patch-scripts_airodump-ng-oui-update
19380 views
--- scripts/airodump-ng-oui-update.orig
+++ scripts/airodump-ng-oui-update
@@ -44,50 +44,37 @@ if [ ! -d "${OUI_PATH}" ]; then
mkdir -p ${OUI_PATH}
fi
-if [ ${CURL} ] || [ ${WGET} ]; then
- # Delete previous partially downloaded file (if the script was aborted)
- rm -f ${OUI_IEEE} >/dev/null 2>/dev/null
-
- # Download it
- echo "[*] Downloading IEEE OUI file..."
-
- if [ ${WGET} ]; then
- ${WGET} ${OUI_DOWNLOAD_URL} -O ${OUI_IEEE} >/dev/null 2>/dev/null
- else
- ${CURL} -L ${OUI_DOWNLOAD_URL} > ${OUI_IEEE} 2>/dev/null
- fi
-
- if [ "${?}" -ne 0 ]; then
- echo "[*] Error: Failed to download OUI list, aborting..."
- exit 1
- fi
-
- # Parse the downloaded OUI list
- echo "[*] Parsing OUI file..."
-
- # Keep the previous file
- if [ -f "${OUI_DOWNLOADED}" ]; then
- mv ${AIRODUMP_NG_OUI} ${OUI}-old
- fi
-
- # Parse it
- grep "(hex)" ${OUI_IEEE} | sed 's/^[ \t]*//g;s/[ \t]*$//g' > ${AIRODUMP_NG_OUI}
- if [ "${?}" -ne 0 ]; then
- echo "[*] Error: Failed to parse OUI, aborting..."
- exit 1
- fi
-
- # Cleanup
- rm -f ${OUI_IEEE}
-
- echo "[*] Airodump-ng OUI file successfully updated"
-else
- if [ -f "${OUI}" ]; then
- echo "[*] Please install curl or wget to update OUI list"
- else
- echo "[*] Please install curl or wget to install OUI list"
- fi
+# Delete previous partially downloaded file (if the script was aborted)
+rm -f ${OUI_IEEE} >/dev/null 2>/dev/null
+
+# Download it
+echo "[*] Downloading IEEE OUI file..."
+
+fetch -o "${OUI_IEEE}" ${OUI_DOWNLOAD_URL}
+
+if [ "${?}" -ne 0 ]; then
+ echo "[*] Error: Failed to download OUI list, aborting..."
exit 1
fi
+# Parse the downloaded OUI list
+echo "[*] Parsing OUI file..."
+
+# Keep the previous file
+if [ -f "${OUI_DOWNLOADED}" ]; then
+ mv ${AIRODUMP_NG_OUI} ${OUI}-old
+fi
+
+# Parse it
+grep "(hex)" ${OUI_IEEE} | sed 's/^[ \t]*//g;s/[ \t]*$//g' > ${AIRODUMP_NG_OUI}
+if [ "${?}" -ne 0 ]; then
+ echo "[*] Error: Failed to parse OUI, aborting..."
+ exit 1
+fi
+
+# Cleanup
+rm -f ${OUI_IEEE}
+
+echo "[*] Airodump-ng OUI file successfully updated"
+
exit 0