1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/bash
options=""
target=`uname -n`
TEMP=`getopt -o DGQVN:U:v:i:l:r: --long resource-id:,node:,uname:,attr-value:,delete-attr,get-value,attr-id:,lifetime:,quiet \
-n 'crm_failcount' -- "$@"`
if [ $? != 0 ] ; then echo "crm_failcount - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
-N|--node) target="$2"; shift; shift;;
-U|--uname) target="$2"; shift; shift;;
-v|--attr-value|-i|--attr-id) options="$options $1 $2"; shift; shift;;
-Q|--quiet|-D|--delete-attr|-G|--get-value|-V) options="$options $1"; shift;;
-r|--resource-id) options="$options -n fail-count-$2"; shift; shift;;
--) shift ; break ;;
*) echo "crm_failcount - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1;;
esac
done
crm_attribute -N $target $options -t status -d 0
|