]> git.pld-linux.org Git - packages/monitoring-plugin-check_file_exists.git/commitdiff
release 1.2 master auto/th/monitoring-plugin-check_file_exists-1.2-1
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 14 Jul 2017 17:17:22 +0000 (20:17 +0300)
committerElan Ruusamäe <glen@pld-linux.org>
Fri, 14 Jul 2017 17:17:22 +0000 (20:17 +0300)
check_file_exists.sh
monitoring-plugin-check_file_exists.spec

index 77a0222f4537f87096f7bf08b835bf863d20f061..2afd5c12e13140c51b114c928666a8243d53d514 100755 (executable)
@@ -3,8 +3,9 @@
 # Author : Diego Martin Gardella [dgardella@gmail.com]
 # Desc : Plugin to verify if a file exists
 #
-# v1.0: Initial version by Diego Martin Gardella [dgardella@gmail.com]
-# v1.1: Add negate support, by Elan Ruusamäe <glen@pld-linux.org>
+# v1.0: Initial version by (Diego Martin Gardella [dgardella@gmail.com])
+# v1.1: Add negate support (Elan Ruusamäe <glen@pld-linux.org>)
+# v1.2: Also check if file is folder (Simon Smit)
 
 PROGNAME=`basename $0`
 PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
@@ -32,12 +33,13 @@ state_name() {
 
 exists() {
        $negate && STATE=$STATE_CRITICAL || STATE=$STATE_OK
-       echo "$(state_name): $1 EXISTS :: `head -3 $1`" # shows the first three lines of the file
+       # shows the first three lines of the file
+       echo "$(state_name): $1 EXISTS :: `head -3 $1`"
 }
 
 exists_dir() {
-    $negate && STATE=$STATE_CRITICAL || STATE=$STATE_OK
-    echo "$(state_name): $1 EXISTS :: Directory" # don't show the first three lines of the file
+       $negate && STATE=$STATE_CRITICAL || STATE=$STATE_OK
+       echo "$(state_name): $1 EXISTS :: Directory"
 }
 
 not_exists() {
@@ -77,7 +79,7 @@ fi
 if [ -f "$1" ]; then
        exists "$1"
 elif [ -d "$1" ]; then
-    exists_dir "$1"
+       exists_dir "$1"
 else
        not_exists "$1"
 fi
index 20ee9d878fbe14433d6db15b4c316c6a5c41d945..ba14d33a2961be8500c05474e3f67abe4409116a 100644 (file)
@@ -1,7 +1,7 @@
 %define                plugin  check_file_exists
 Summary:       Monitoring plugin to check if a file exists or not
 Name:          monitoring-plugin-%{plugin}
-Version:       1.1
+Version:       1.2
 Release:       1
 License:       GPL
 Group:         Networking
This page took 0.088159 seconds and 4 git commands to generate.