Skip to content

Instantly share code, notes, and snippets.

@bbhenry
Last active January 2, 2016 21:29
Show Gist options
  • Save bbhenry/8363594 to your computer and use it in GitHub Desktop.
Save bbhenry/8363594 to your computer and use it in GitHub Desktop.
bash script template
#!/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