diff --git a/tools/crm_failcount b/tools/crm_failcount index 273e298cfb..14f0d9e462 100755 --- a/tools/crm_failcount +++ b/tools/crm_failcount @@ -1,24 +1,25 @@ #!/bin/bash options="" target=`uname -n` -TEMP=`getopt -o DGQVN:v:i:l:r: --long resource-id:,node:,attr-value:,delete-attr,get-value,attr-id:,lifetime:,quiet \ +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;; *) 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 diff --git a/tools/crm_master b/tools/crm_master index 26f5859f1f..09fbb5e273 100755 --- a/tools/crm_master +++ b/tools/crm_master @@ -1,25 +1,25 @@ #!/bin/bash if [ -z "$OCF_RESOURCE_INSTANCE" ]; then echo "This program should only ever be invoked from inside an OCF resource agent" echo "DO NOT INVOKE MANUALLY FROM THE COMMAND LINE" exit 1 fi -TEMP=`getopt -o DGQVN:v:i:l: --long node:,attr-value:,delete-attr,get-value,attr-id:,lifetime:,quiet \ +TEMP=`getopt -o DGQVN:U:v:i:l: --long node:,uname:,attr-value:,delete-attr,get-value,attr-id:,lifetime:,quiet \ -n 'crm_master' -- "$@"` if [ $? != 0 ] ; then echo "crm_master - 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|-v|--attr-value|-i|--attr-id|-l|--lifetime) options="$options $1 $2"; shift; shift;; + -N|--node|-U|--uname|-v|--attr-value|-i|--attr-id|-l|--lifetime) options="$options $1 $2"; shift; shift;; -Q|--quiet|-D|--delete-attr|-G|--get-value|-V) options="$options $1"; shift;; *) echo "crm_master - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1;; esac done crm_attribute -N `uname -n` -n master-$OCF_RESOURCE_INSTANCE $options diff --git a/tools/crm_standby b/tools/crm_standby index 6577515239..5eb364714e 100755 --- a/tools/crm_standby +++ b/tools/crm_standby @@ -1,57 +1,58 @@ #!/bin/bash done=0 options="" target=`uname -n` lifetime=0 do_get=1 op='g' -TEMP=`getopt -o DGQVN:v:i:l: --long node:,attr-value:,delete-attr,get-value,attr-id:,lifetime:,quiet \ +TEMP=`getopt -o DGQVN:U:v:i:l: --long node:,uname:,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;; -i|--attr-id) options="$options $1 $2"; shift; shift;; -l|--lifetime) options="$options $1 $2"; lifetime=1; shift; shift;; -Q|--quiet|-V) options="$options $1"; shift;; --) shift ; break ;; *) echo "crm_standby - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1;; esac done case $op in g) crm_attribute -N $target -n standby $cmd $options -l forever 2>&1 > /dev/null if [ $? = 0 ]; then crm_attribute -N $target -n standby $options -l forever exit 0 fi crm_attribute -N $target -n standby $cmd $options -l reboot -d off ;; u) if [ $lifetime = 0 ]; then options="$options -l forever" fi crm_attribute -N $target -n standby $options ;; d) if [ $lifetime = 0 ]; then crm_attribute -N $target -n standby $options -l forever crm_attribute -N $target -n standby $options -l reboot else crm_attribute -N $target -n standby $options fi ;; esac