#!/bin/sh #------------------------------------------------------------------------------ # /var/install/bin/arpscan-update-mac-lists - update mac lists # # Copyright (c) 2017-2020 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2017-11-19 jed # Last Update: $Id$ # # Usage: arpscan-update-mac-lists [--auto] # # Parameter: --auto - force non-interactive mac lists update # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------ # read eislib etc. . /var/install/include/eislib #------------------------------------------------------------------------------ # show wait #------------------------------------------------------------------------------ show_wait () { mecho -n " wait [ " colpos=1 while [ -n "`ps --no-headers $!`" ] do mecho --info -n "." sleep 1 colpos=`expr ${colpos} + 1` if [ "${colpos}" -ge 52 ] then mecho " ]" mecho -n " wait [ " colpos=1 fi done mecho " ] " } #------------------------------------------------------------------------------ # force mac list update #------------------------------------------------------------------------------ mac_list_update () { echo "updating ieee-iab.txt file ..." /usr/bin/get-iab -f ${generate_ieeeiab} >/dev/null 2>/dev/null & # entertain the user show_wait # evaluate exit code wait $! dtou ${generate_ieeeiab} echo echo "updating ieee-oui.txt file ..." /usr/bin/get-oui -f ${generate_ieeeoui} >/dev/null 2>/dev/null & # entertain the user show_wait # evaluate exit code wait $! dtou ${generate_ieeeoui} } #============================================================================== # main #============================================================================== arpscan_sharepath=/usr/share/arp-scan generate_ieeeiab=${arpscan_sharepath}/ieee-iab.txt generate_ieeeoui=${arpscan_sharepath}/ieee-oui.txt automatic=0 if [ "$1" = '--auto' -o "$1" = '--automatic' ] then automatic=1 fi if [ ${automatic} -eq 1 ] then mac_list_update else # interactive clrhome mecho --info "Updating IEEE mac lists" echo if /var/install/bin/ask "Update IEEE mac lists now" "n" then echo mac_list_update echo anykey fi fi #============================================================================== # end #============================================================================== exit 0