aboutsummaryrefslogtreecommitdiff
path: root/net/apipa.sh
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-10 21:46:08 -0500
committerMike Frysinger <vapier@gentoo.org>2011-11-19 02:25:36 -0500
commitef1ff1b4f29762d1caf83dc2b65ccfc7cb96e140 (patch)
treef1ebb65eec6eb156a0fba737bcd5386af2a9ebfe /net/apipa.sh
parent0510c473d4cd9097401e3a7bc236b0121977b81d (diff)
make shell math operations style more succulent
Convert the style: var=$((${var} + 1)) to: : $(( var += 1 )) The latter is easier to read imo. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'net/apipa.sh')
-rw-r--r--net/apipa.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/apipa.sh b/net/apipa.sh
index 3163104d..ae61233b 100644
--- a/net/apipa.sh
+++ b/net/apipa.sh
@@ -26,20 +26,20 @@ apipa_start()
eindent
while [ ${i} -lt 64516 ]; do
- i1=$((($(_random) % 255) + 1))
- i2=$((($(_random) % 255) + 1))
+ : $(( i1 = (_random % 255) + 1 ))
+ : $(( i2 = (_random % 255) + 1 ))
addr="169.254.${i1}.${i2}"
vebegin "${addr}/16"
if ! arping_address "${addr}"; then
eval config_${config_index}="\"${addr}/16 broadcast 169.254.255.255\""
- config_index=$((${config_index} - 1))
+ : $(( config_index -= 1 ))
veend 0
eoutdent
return 0
fi
- i=$((${i} + 1))
+ : $(( i += 1 ))
done
eerror "No free address found!"