Skip to content

Commit

Permalink
Fix bashisms in rabbitmq OCF RA
Browse files Browse the repository at this point in the history
Change "printf %b" to be passing the checkbashisms.

Signed-off-by: Bogdan Dobrelya <[email protected]>
  • Loading branch information
Bogdan Dobrelya committed Aug 18, 2016
1 parent b02d325 commit f7d5d6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/rabbitmq-server-ha.ocf
Original file line number Diff line number Diff line change
Expand Up @@ -1616,13 +1616,13 @@ get_monitor() {

elif [ -n "${queues}" ]; then
local q_c
q_c=`printf "%b\n" "${queues}" | wc -l`
q_c=`printf %b "${queues}\n" | wc -l`
local mem
mem=`printf "%b\n" "${queues}" | awk -v sum=0 '{sum+=$1} END {print (sum/1048576)}'`
mem=`printf %b "${queues}\n" | awk -v sum=0 '{sum+=$1} END {print (sum/1048576)}'`
local mes
mes=`printf "%b\n" "${queues}" | awk -v sum=0 '{sum+=$2} END {print sum}'`
mes=`printf %b "${queues}\n" | awk -v sum=0 '{sum+=$2} END {print sum}'`
local c_u
c_u=`printf "%b\n" "${queues}" | awk -v sum=0 -v cnt=${q_c} '{sum+=$3} END {print (sum+1)/(cnt+1)}'`
c_u=`printf %b "${queues}\n" | awk -v sum=0 -v cnt=${q_c} '{sum+=$3} END {print (sum+1)/(cnt+1)}'`
local status
status=`echo $(su_rabbit_cmd "${OCF_RESKEY_ctl} -q status")`
ocf_log info "${LH} RabbitMQ is running ${q_c} queues consuming ${mem}m of ${TOTALVMEM}m total, with ${mes} queued messages, average consumer utilization ${c_u}"
Expand Down

0 comments on commit f7d5d6e

Please sign in to comment.