commit 14385f2cd78d6950c0d4fb14edf6c1ce896a81c0
Author: Elan Ruusamäe <[email protected]>
Date:   Sat Oct 26 22:54:24 2013 +0300

    v1.2.5: handle academical .uk domains (*.ac.uk, *.gov.uk)
    
    thanks James Angland

 check_domain.sh                 | 15 ++++++++++++++-
 nagios-plugin-check_domain.spec |  2 +-
 test.sh                         |  1 +
 3 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/nagios-plugin-check_domain.spec b/nagios-plugin-check_domain.spec
index fd225cf..e869fc1 100644
--- a/nagios-plugin-check_domain.spec
+++ b/nagios-plugin-check_domain.spec
@@ -1,7 +1,7 @@
 %define                plugin  check_domain
 Summary:       Nagios plugin for checking a domain name expiration date
 Name:          nagios-plugin-%{plugin}
-Version:       1.2.4
+Version:       1.2.5
 Release:       1
 License:       GPL
 Group:         Networking
diff --git a/check_domain.sh b/check_domain.sh
index 0e6f9eb..679a0ad 100755
--- a/check_domain.sh
+++ b/check_domain.sh
@@ -33,7 +33,7 @@ die() {
 
 fullusage() {
        cat <<EOF
-check_domain - v1.2.4
+check_domain - v1.2.5
 Copyright (c) 2005 Tomàs Núñez Lirola <[email protected]>, 2009-2013 Elan 
Ruusamäe <[email protected]>
 under GPL License
 
@@ -116,10 +116,12 @@ case "$domain" in
        # paid-till: 2013.11.01
        expiration=$(echo "$out" | sed -rne 
's;paid-till:[^0-9]+([0-9]{4})\.([0-9]{1,2})\.([0-9]{2});\1-\2-\3;p')
        ;;
+
 *.ee)
        # expire: 16.11.2013
        expiration=$(echo "$out" | sed -rne 
's;expire:[^0-9]+([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{4});\3-\2-\1;p')
        ;;
+
 *.tv)
        # Expiration Date: 2017-01-26T10:14:11Z
        expiration=$(echo "$out" | sed -rne 's;Expiration 
Date:[^0-9]+([0-9]{4}-[0-9]{2}-[0-9]{2})T[0-9:Z]+;\1;p')
@@ -128,16 +130,27 @@ case "$domain" in
        # Expiry date: 2017/07/16
        expiration=$(echo "$out" | sed -rne 's;Expiry 
date:[^0-9]+([0-9]{4})/([0-9]{1,2})/([0-9]{2});\1-\2-\3;p')
        ;;
+
 *.ie)
        # renewal: 31-March-2016
        set -- $(echo "$out" | awk '/renewal:/{split($2, a, "-"); printf("%s %s 
%s\n", a[3], a[2], a[1])}')
        set -- "$1" "$(month2moy $2)" "$3"
        expiration="$1-$2-$3"
        ;;
+
 *.dk)
        # Expires: 2014-01-31
        expiration=$(echo "$out" | awk '/Expires:/ {print $2}')
        ;;
+
+*.ac.uk|*.gov.uk)
+       # Renewal date:
+       #   Monday 21st Sep 2015
+       set -- $(echo "$out" | awk '/Renewal date:/{renewal = 1; next} {if 
(renewal) {print $0; exit}}')
+       set -- "$4" "$(mon2moy $3)" $(echo "$2" | sed -re 's,[^0-9]+,,')
+       expiration="$1-$2-$3"
+       ;;
+
 *.uk)
        # Expiry date:  05-Dec-2014
        set -- $(echo "$out" | awk '/Expiry date:/{split($3, a, "-"); 
printf("%s %s %s\n", a[3], a[2], a[1])}')
diff --git a/test.sh b/test.sh
index 4e72b38..f2d9c84 100755
--- a/test.sh
+++ b/test.sh
@@ -18,6 +18,7 @@ amazon.ca
 amazon.ie
 amazon.co.uk
 dk-hostmaster.dk
+bbk.ac.uk
 "
 
 for domain in $domains; do
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugin-check_domain.git/commitdiff/14385f2cd78d6950c0d4fb14edf6c1ce896a81c0

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to