nvchecker: add idracadm7
This commit is contained in:
parent
d13606e2f5
commit
8e396e2d1c
2 changed files with 37 additions and 0 deletions
|
@ -1497,6 +1497,10 @@ cmd = "./.repo/pkgver/samhain.sh"
|
|||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/sendmail.sh"
|
||||
|
||||
[idracadm7]
|
||||
source = "cmd"
|
||||
cmd = "./.repo/pkgver/idracadm7.sh"
|
||||
|
||||
# git
|
||||
|
||||
[pounce]
|
||||
|
|
33
.repo/pkgver/idracadm7.sh
Executable file
33
.repo/pkgver/idracadm7.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# check dependencies
|
||||
count=0
|
||||
for dependency in curl hxnormalize hxselect grep sed sort tail; do
|
||||
if [ ! -x "$(command -v $dependency)" ]; then
|
||||
echo "$dependency missing"
|
||||
count=$((count+1))
|
||||
fi
|
||||
done
|
||||
|
||||
# exit script if any dependencies missing
|
||||
if [ $count -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# upstream URL
|
||||
UPSTREAM_URL="https://linux.dell.com/repo/community/openmanage/index.html"
|
||||
|
||||
# options to pass to cURL, including custom user agent
|
||||
USER_AGENT="omsa-version-checker/1.0 george@rawlinson.net.nz"
|
||||
CURL_OPTS=(--silent --user-agent "$USER_AGENT")
|
||||
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" | \
|
||||
hxnormalize -x | \
|
||||
hxselect -c 'td>center' -s '\n' | \
|
||||
grep '^v.*' | \
|
||||
grep --invert-match '*\|,' | \
|
||||
sed 's/^v//' | \
|
||||
sort -n | \
|
||||
tail -n 1
|
||||
exit 0
|
Loading…
Reference in a new issue