Add drone-ci lint and deployment test
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jan 2020-06-07 21:36:24 +02:00
parent 7446f7606a
commit 3ea2edb740
3 changed files with 34 additions and 7 deletions

21
.drone.yml Normal file
View File

@ -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

View File

@ -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

View File

@ -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 "<html" $F >/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 "<html" "$F" >/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 "<html" $F >/dev/null; then
mv $F mibs/$1.mib
if wget -qO "$F" "https://iphostmonitor.com/mib/$1.html"; then
if ! grep "<html" "$F" >/dev/null; then
mv "$F" "mibs/$1.mib"
exit 0
fi
echo "MIB not found on iphostmonitor.com" >&2