Last active
January 2, 2016 21:29
-
-
Save bbhenry/8363594 to your computer and use it in GitHub Desktop.
bash script template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROGNAME=`basename $0` | |
CRIT=15 | |
WARN=30 | |
usage() { | |
echo "$PROGNAME -H <FQDN> [-c <15>] [-w <30>]" | |
echo "-H Mandatory, please put the fully qualified domain name for the SSL Certificate you want to monitor" | |
echo "-c Default 15, the number of days left before it alerts for Critical state" | |
echo "-w Default 30, the number of days left before it alerts for Warning state" | |
exit | |
} | |
while getopts :h:c:w: OPTION | |
do | |
case $OPTION in | |
h) | |
HOST=${OPTARG} | |
;; | |
c) | |
CRIT=${OPTARG} | |
;; | |
w) | |
WARN=${OPTARG} | |
;; | |
*) | |
usage | |
;; | |
esac | |
done | |
if [[ -z ${HOST} ]]; then | |
usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment