mibs-downloader/mib-downloader.sh

21 lines
257 B
Bash
Executable File

#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <MIB name>" >&2
exit 2
fi
gc(){
test -f $F && rm $F
}
trap gc EXIT
F=$(mktemp)
if wget -qO $F "https://iphostmonitor.com/mib/$1.html"; then
mv $F mibs/$1.mib
exit 0
fi
echo "$1 not found" >&2
exit 1