From 9949d52e4b15645532b4fe5870c3f9ac4ee009be Mon Sep 17 00:00:00 2001 From: Elyrith Date: Tue, 4 Jun 2013 17:40:02 -0400 Subject: [PATCH] Add my name to Author as a contributor. --- check_sha512.sh | 172 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100755 check_sha512.sh diff --git a/check_sha512.sh b/check_sha512.sh new file mode 100755 index 0000000..5396466 --- /dev/null +++ b/check_sha512.sh @@ -0,0 +1,172 @@ +#!/bin/bash + +################################################################################ +# # +# Copyright (C) 2012 Jack-Benny Persson # +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +################################################################################ + +############################################################################### +# # +# Nagios plugin to monitor a single files SHA512 sum. In case of mismatch # +# the plugin exit with a CRICITAL error code. This behavior can be changed # +# with the --warning argument. # +# Written in Bash (and uses sed & awk). # +# # +############################################################################### + + +VERSION="1.1" +AUTHOR="(c) 2012 Jack-Benny Persson (jack-benny@cyberinfo.se), modified for SHA512 by Ryan Loudfoot (elyrith@gmail.com)" + +# Exit codes +STATE_OK=0 +STATE_WARNING=1 +STATE_CRITICAL=2 +STATE_UNKNOWN=3 + +shopt -s extglob + +#### Functions #### + +# Print version information +print_version() +{ + printf "\n\n$0 - $VERSION\n" +} + +#Print help information +print_help() +{ + print_version + printf "$AUTHOR\n" + printf "Monitor the SHA512 checksum of a single file\n" +/bin/cat <