[Script]: Simple Kimsufi KS-1 Notification Script

Hey,

just a little script to check if a KS-1 is available:

#!/bin/bash
#Simple KS-1 Notification Script
#Alexander Krischan - http://krischan.eu
#16.10.2015

#API abrufen und verarbeiten
curl https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2 -o api -silent
cat api | tr "," "\n" > out
num=`grep -A 31 150sk10 out | grep -c 1H-high`

#Mail erstellen
echo "KS-1 Available" > mail
echo "Buy here: http://www.kimsufi.com/de/index.xml" >> mail
echo "or here: http://kimsufi.com/en/order/kimsufi.cgi?hard=142sk1&dedicatedQuantity=1" >> mail
echo "" >> mail
echo "Output:" >> mail
grep -A 31 150sk10 out >> mail

#Auf Verfuegbarkeit pruefen
if [ $num = 0 ]; then
exit
else
mail -s "Kimsufi KS-1 Available!" sample@domain.com < mail
fi
exit

Faulwurf