indent properly

This commit is contained in:
Guillaume Coré
2013-04-25 14:25:48 -04:00
parent f910d9e246
commit 123a8e2b57
+65 -65
View File
@@ -10,34 +10,34 @@ ST_UK=3
ST_FINAL=$ST_UK ST_FINAL=$ST_UK
print_version() { print_version() {
echo "$VERSION $AUTHOR" echo "$VERSION $AUTHOR"
} }
print_help() { print_help() {
print_version $PROGNAME $VERSION print_version $PROGNAME $VERSION
echo "" echo ""
echo "$PROGNAME is a Nagios plugin to monitor Galera cluster status." echo "$PROGNAME is a Nagios plugin to monitor Galera cluster status."
echo "" echo ""
echo "$PROGNAME -u USER -p PASSWORD [-H HOST] [-P PORT] [-w SIZE] [-c SIZE] [-f FLOAT] [-0]" echo "$PROGNAME -u USER -p PASSWORD [-H HOST] [-P PORT] [-w SIZE] [-c SIZE] [-f FLOAT] [-0]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " u)" echo " u)"
echo " MySQL user." echo " MySQL user."
echo " p)" echo " p)"
echo " MySQL password." echo " MySQL password."
echo " H)" echo " H)"
echo " MySQL host. Default is localhost." echo " MySQL host. Default is localhost."
echo " P)" echo " P)"
echo " MySQL port. Default is 3306." echo " MySQL port. Default is 3306."
echo " w)" echo " w)"
echo " Sets minimum number of nodes in the cluster when WARNING is raised. (default is same as critical)." echo " Sets minimum number of nodes in the cluster when WARNING is raised. (default is same as critical)."
echo " c)" echo " c)"
echo " Sets minimum number of nodes in the cluster when CRITICAL is raised. (default is 2)." echo " Sets minimum number of nodes in the cluster when CRITICAL is raised. (default is 2)."
echo " f)" echo " f)"
echo " Sets critical value of wsrep_flow_control_paused (default is 0.1)." echo " Sets critical value of wsrep_flow_control_paused (default is 0.1)."
echo " 0)" echo " 0)"
echo " Rise CRITICAL if the node is not primary" echo " Rise CRITICAL if the node is not primary"
exit $ST_UK exit $ST_UK
} }
# default values # default values
@@ -47,49 +47,49 @@ mysqlhost='localhost'
fcp=0.1 fcp=0.1
while getopts “hvu:p:H:P:w:c:f:0” OPTION; do while getopts “hvu:p:H:P:w:c:f:0” OPTION; do
case $OPTION in case $OPTION in
h) h)
print_help print_help
exit $ST_UK exit $ST_UK
;; ;;
v) v)
print_version $PROGNAME $VERSION print_version $PROGNAME $VERSION
exit $ST_UK exit $ST_UK
;; ;;
u) u)
mysqluser=$OPTARG mysqluser=$OPTARG
;; ;;
p) p)
password=$OPTARG password=$OPTARG
;; ;;
H) H)
mysqlhost=$OPTARG mysqlhost=$OPTARG
;; ;;
P) P)
port=$OPTARG port=$OPTARG
;; ;;
w) w)
warn=$OPTARG warn=$OPTARG
;; ;;
c) c)
crit=$OPTARG crit=$OPTARG
;; ;;
f) f)
fcp=$OPTARG fcp=$OPTARG
;; ;;
0) 0)
primary='TRUE' primary='TRUE'
;; ;;
?) ?)
echo "Unknown argument: $1" echo "Unknown argument: $1"
print_help print_help
exit $ST_UK exit $ST_UK
;; ;;
esac esac
done done
if [ -z "$warn" ]; then if [ -z "$warn" ]; then
warn=$crit warn=$crit
fi fi
# MANDATORY args # MANDATORY args