mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-06 21:45:10 +01:00
Auto-download on demand and give warning if file is old
This commit is contained in:
14
bin/mac.sh
14
bin/mac.sh
@@ -14,9 +14,21 @@ ouilocation="${HOME}/.dot/oui.txt"
|
||||
#################
|
||||
|
||||
if [ ! -f "${ouilocation}" ] ; then
|
||||
echo 'OUI location can not be found. Have you updated the config?' 1>&2
|
||||
echo "OUI location can not be found at ${ouilocation}. Have you updated the config?" 1>&2
|
||||
read -p "Do you want to download it now [y/N]? " -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
wget https://standards-oui.ieee.org/oui/oui.txt -O "${ouilocation}"
|
||||
else
|
||||
echo "Aborted"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $(find "${ouilocation}" -mtime +30 -print) ]]; then
|
||||
echo "File ${ouilocation} is older than 30 days"
|
||||
fi
|
||||
|
||||
if [ -z "${1}" ] ; then
|
||||
echo 'No mac address specified, please do so as first argument' 1>&2
|
||||
|
||||
Reference in New Issue
Block a user