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:
16
bin/mac.sh
16
bin/mac.sh
@@ -14,8 +14,20 @@ ouilocation="${HOME}/.dot/oui.txt"
|
|||||||
#################
|
#################
|
||||||
|
|
||||||
if [ ! -f "${ouilocation}" ] ; then
|
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
|
||||||
exit 1
|
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
|
fi
|
||||||
|
|
||||||
if [ -z "${1}" ] ; then
|
if [ -z "${1}" ] ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user