diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1f61ec6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,21 @@ +--- + +kind: pipeline +typo: docker + +steps: + - name: shellcheck + image: koalaman/shellcheck-alpine:latest + + commands: + - grep -rl '^#!/.*sh' * | xargs -n1 shellcheck + + - name: deploy + image: debian:buster + + environment: + DEBIAN_FRONTEND: noninteractive + commands: + - apt-get -qq update && apt-get install -yf wget + - bash mib-downloader.sh PowerNet-MIB + - bash mib-downloader.sh IDRAC-MIB diff --git a/README.md b/README.md index 45ce26a..4437137 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +# MIB Downloader + +[![Build Status](https://drone.binary-kitchen.de/api/badges/sprinterfreak/mibs-downloader/status.svg?ref=refs/heads/master)](https://drone.binary-kitchen.de/sprinterfreak/mibs-downloader) + +Search and dowload mibs from different sources + ## Important MIBs This is a set of important mibs diff --git a/mib-downloader.sh b/mib-downloader.sh index f579124..a310429 100755 --- a/mib-downloader.sh +++ b/mib-downloader.sh @@ -6,23 +6,23 @@ if [ -z "$1" ]; then fi gc(){ - test -f $F && rm $F + test -f "$F" && rm "$F" } trap gc EXIT F=$(mktemp) -if wget -qO $F "http://www.circitor.fr/Mibs/Mib/${1:0:1}/$1.mib"; then - if ! grep "/dev/null; then - mv $F mibs/$1.mib +if wget -qO "$F" "http://www.circitor.fr/Mibs/Mib/${1:0:1}/$1.mib"; then + if ! grep "/dev/null; then + mv "$F" "mibs/$1.mib" exit 0 fi echo "MIB not found on circitor.fr" >&2 fi -if wget -qO $F "https://iphostmonitor.com/mib/$1.html"; then - if ! grep "/dev/null; then - mv $F mibs/$1.mib +if wget -qO "$F" "https://iphostmonitor.com/mib/$1.html"; then + if ! grep "/dev/null; then + mv "$F" "mibs/$1.mib" exit 0 fi echo "MIB not found on iphostmonitor.com" >&2