Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory

Vincenth

Reviews(1)
byVincenth, May 31, 2015
1 of 1 people found this review helpful
for the errors :

ERROR:
[: 89: XXX: unexpected operator

you have to change all tests "==" by a simple "="

tested on ubuntu 12.04

here is my correction to add .fr domains (thanks to marc.lecrosnier for his original version)
My whois return "Expiry Date" not "anniversary"


Line 86 :
elif [ ${DLTYPE} == 'fr' ];
then
TYPE=afnic
WHOIS_SERVER="whois.nic.fr"



Line : 131
# for .fr domains
elif [ $TYPE = 'afnic' ];
then
day=`cat ${FILE} | awk '/Expiry Date:/' | cut -d ':' -f2 | cut -d ' ' -f2 | cut -d '/' -f1`
month=`cat ${FILE} | awk '/Expiry Date:/' | cut -d ':' -f2 | cut -d ' ' -f2 | cut -d '/' -f2`
year=$(date +%Y)
getmonth()
{
case $month in
01) echo jan ;;
02) echo feb ;;
03) echo mar ;;
04) echo apr ;;
05) echo may ;;
06) echo jun ;;
07) echo jul ;;
08) echo aug ;;
09) echo sep ;;
10) echo oct ;;
11) echo nov ;;
12) echo dec ;;
*) echo 0 ;;
esac
}

if [ $(($(date -d "$day-$(getmonth $month)-$year" +%s)-$(date +%s))) -lt 0 ];
then
year=$(($(date +%Y)+1))
fi

expiration=$day-$(getmonth $month)-$year