Created
January 28, 2013 08:41
-
-
Save strnh/4653962 to your computer and use it in GitHub Desktop.
Dell warranty check for FreeBSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requirements: net/curl
lang/gawk (?)