Skip to content

Instantly share code, notes, and snippets.

@strnh
Created January 28, 2013 08:41
Show Gist options
  • Save strnh/4653962 to your computer and use it in GitHub Desktop.
Save strnh/4653962 to your computer and use it in GitHub Desktop.
Dell warranty check for FreeBSD
#!/bin/sh
if [ $1 = ""] ; then
echo $1
SERIAL=`kenv | grep system | grep serial | awk 'BEGIN{FS="="}{ print substr(substr( $2,2),1,7)}'`
else
SERIAL=$1
fi
echo "Service Tag :" $SERIAL
/usr/local/bin/curl -G "http://www.dell.com/support/troubleshooting/jp/ja/jpbsd1/Servicetag/"$SERIAL 2>/dev/null |\
grep -A1 TopTwoWarrantyListItem | strings | grep \<b\>| \
gawk 'BEGIN{FS="<b>"}{ a=substr($3,0,10); if (a>b) { b=a; } }END {print "EOL of DirectLine: " b }'
@strnh
Copy link
Author

strnh commented Jan 28, 2013

Requirements: net/curl
lang/gawk (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment