1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-scripts: Avoid shellcheck warning SC2004 ($ in arithmetic)

SC2004: $/${} is unnecessary on arithmetic variables.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2016-07-06 16:50:30 +10:00 committed by Amitay Isaacs
parent efc9af2634
commit 13b3c6af64
6 changed files with 14 additions and 14 deletions

View File

@ -263,7 +263,7 @@ start()
fi
fi
_count=$(($_count + 1))
_count=$((_count + 1))
sleep 1
done
@ -292,7 +292,7 @@ stop()
break
fi
_count=$(($_count + 1))
_count=$((_count + 1))
sleep 1
done

View File

@ -48,7 +48,7 @@ ipv4_is_valid_addr()
if ! [ 0 -le $_o -a $_o -le 255 ] 2>/dev/null ; then
return 1
fi
_count=$(($_count + 1))
_count=$((_count + 1))
done
# A valid IPv4 address has 4 octets
@ -75,18 +75,18 @@ ipv4_host_addr_to_net ()
# the octets and doing the math.
_host_ul=0
for _o in $(export IFS="." ; echo $_host) ; do
_host_ul=$(( ($_host_ul << 8) + $_o)) # work around Emacs color bug
_host_ul=$(( (_host_ul << 8) + _o)) # work around Emacs color bug
done
# Calculate the mask and apply it.
_mask_ul=$(( 0xffffffff << (32 - $_maskbits) ))
_net_ul=$(( $_host_ul & $_mask_ul ))
_mask_ul=$(( 0xffffffff << (32 - _maskbits) ))
_net_ul=$(( _host_ul & _mask_ul ))
# Now convert to a network address one byte at a time.
_net=""
for _o in $(seq 1 4) ; do
_net="$(($_net_ul & 255))${_net:+.}${_net}"
_net_ul=$(($_net_ul >> 8))
_net="$((_net_ul & 255))${_net:+.}${_net}"
_net_ul=$((_net_ul >> 8))
done
echo "${_net}/${_maskbits}"
@ -142,7 +142,7 @@ ensure_table_id_for_ip ()
# redirect stops error spam for a non-numeric value.
if [ $_new -le $_t -a \
$_t -le $CTDB_PER_IP_ROUTING_TABLE_ID_HIGH ] 2>/dev/null ; then
_new=$(($_t + 1))
_new=$((_t + 1))
fi
done

View File

@ -49,7 +49,7 @@ multipathd_check()
_timeleft=10
while [ $_timeleft -gt 0 ]; do
_timeleft=$(($_timeleft - 1))
_timeleft=$((_timeleft - 1))
# see if the process still exists
kill -0 $_pid >/dev/null 2>&1 || {

View File

@ -153,7 +153,7 @@ nfs_check_service ()
fi
if [ $restart_every -gt 0 ] ; then
if [ $(($_failcount % $restart_every)) -eq 0 ] ; then
if [ $((_failcount % restart_every)) -eq 0 ] ; then
if ! $_unhealthy ; then
echo "WARNING: $_err"
fi

View File

@ -306,7 +306,7 @@ program_stack_traces ()
if [ -n "$_stack" ] ; then
echo "Stack trace for ${_prog}[${_pid}]:"
echo "$_stack"
_count=$(($_count + 1))
_count=$((_count + 1))
fi
done
}
@ -475,7 +475,7 @@ kill_tcp_connections ()
_connections="${_connections}${_nl}${_dst} ${_src}"
fi
_killcount=$(($_killcount + 1))
_killcount=$((_killcount + 1))
done
if [ $_killcount -eq 0 ] ; then

View File

@ -192,7 +192,7 @@ case "$1" in
"$smnotify" --client="$cip" --ip="$sip" \
--server="$NFS_HOSTNAME" --stateval="$stateval"
# Send notifies for server startup
stateval=$(($stateval + 1))
stateval=$((stateval + 1))
"$smnotify" --client="$cip" --ip="$sip" \
--server="$sip" --stateval="$stateval"
"$smnotify" --client="$cip" --ip="$sip" \