Build precise queries to find exactly what you need
Press ESC to close
@Vincenth
Favorites0
Views
Projects0
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
Reviewed 10 years ago