diff --git a/tools/crm_failcount b/tools/crm_failcount index 7d9990b23c..94a840060d 100755 --- a/tools/crm_failcount +++ b/tools/crm_failcount @@ -1,52 +1,52 @@ #!/bin/bash options="" -target=`uname -n` +target=`crm_node -n` TEMP=`getopt -o DGQVN:U:v:i:l:r: --long help,version,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;; --version) crm_attribute --version; exit 0;; - --help) - echo "crm_failcount - A convenience wrapper for crm_attribute"; + --help) + echo "crm_failcount - A convenience wrapper for crm_attribute"; echo ""; - echo "Set, update or remove the failcount for the specified resource on the named node"; - echo ""; - echo "Usage: crm_failcount -r resource_name command [options]"; + echo "Set, update or remove the failcount for the specified resource on the named node"; + echo ""; + echo "Usage: crm_failcount -r resource_name command [options]"; echo "Options:" echo " --help This text" echo " --version Version information" echo " -V, --verbose Increase debug output" echo " -q, --quiet Print only the value on stdout" echo "" echo " -r, --resource-id=value The resource to update." echo "" echo "Commands:" echo " -G, --query Query the current value of the attribute/option" echo " -v, --update=value Update the value of the attribute/option" echo " -D, --delete Delete the attribute/option" echo "" echo "Additional Options:" echo " -N, --node=value Set an attribute for the named node (instead of the current one)." echo " -l, --lifetime=value Until when should the setting take affect." echo " Valid values: reboot, forever" echo " -i, --id=value (Advanced) The ID used to identify the attribute" exit 0;; --) shift ; break ;; *) echo "Unknown option: $1. See --help for details." exit 1;; esac done crm_attribute -N $target $options -t status -d 0 diff --git a/tools/crm_standby b/tools/crm_standby index 352ae2f49d..9bf1f26254 100755 --- a/tools/crm_standby +++ b/tools/crm_standby @@ -1,83 +1,83 @@ #!/bin/bash op="" options="" lifetime=0 -target=`uname -n` +target=`crm_node -n` TEMP=`getopt -o qDGQVN:U:v:i:l: --long version,help,node:,uname:,id:,attr-value:,delete-attr,get-value,attr-id:,lifetime:,quiet \ -n 'crm_standby' -- "$@"` if [ $? != 0 ] ; then echo "crm_standby - 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) options="$options $1 $2"; op=u; shift; shift;; -D|--delete-attr) options="$options $1"; op=d; shift;; -G|--get-value) options="$options $1"; op=g; shift;; -l|--lifetime) options="$options $1 $2"; lifetime=1; shift; shift;; -i|--id|--attr-id) options="$options $1 $2"; shift; shift;; -Q|-q|--quiet|-V) options="$options $1"; shift;; --version) crm_attribute --version; exit 0;; - --help) - echo "crm_standby - A convenience wrapper for crm_attribute"; - echo ""; - echo ""; - echo "Put the name node into and out of standby. Nodes in standby mode may not host cluster resources"; - echo ""; - echo "Usage: crm_standby crm_standby command [options]"; + --help) + echo "crm_standby - A convenience wrapper for crm_attribute"; + echo ""; + echo ""; + echo "Put the name node into and out of standby. Nodes in standby mode may not host cluster resources"; + echo ""; + echo "Usage: crm_standby crm_standby command [options]"; echo "Options:" echo " --help This text" echo " --version Version information" echo " -V, --verbose Increase debug output" echo " -q, --quiet Print only the value on stdout" echo "" echo "Commands:" echo " -G, --query Query the current value of the attribute/option" echo " -v, --update=value Update the value of the attribute/option" echo " -D, --delete Delete the attribute/option" echo "" echo "Additional Options:" echo " -N, --node=value Set an attribute for the named node (instead of the current one)." echo " -l, --lifetime=value Until when should the setting take affect." echo " Valid values: reboot, forever" echo " -i, --id=value (Advanced) The ID used to identify the attribute" exit 0;; --) shift ; break ;; *) echo "Unknown option: $1. See --help for details." exit 1;; esac done options="-N $target -n standby $options" if [ x$op = x ]; then options="$options -G"; op=g fi if [ $lifetime = 0 ]; then case $op in g) crm_attribute $options -l forever 2>&1 > /dev/null if [ $? = 0 ]; then options="$options -l forever" else options="$options -l reboot -d off" fi ;; - u) + u) options="$options -l forever" ;; - d) + d) crm_attribute $options -l forever crm_attribute $options -l reboot exit 0 ;; esac fi -#echo crm_attribute $options -crm_attribute $options +#echo crm_attribute $options +crm_attribute $options