File: crm_failcount

package info (click to toggle)
pacemaker 1.0.9.1%2Bhg15626-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 34,668 kB
  • ctags: 5,645
  • sloc: xml: 87,444; ansic: 57,853; python: 11,479; sh: 5,255; makefile: 663; perl: 387; sed: 262
file content (26 lines) | stat: -rwxr-xr-x 931 bytes parent folder | download
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