summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-02-27 06:05:34 (GMT)
committer Mike Frysinger <vapier@gentoo.org>2013-02-27 06:05:34 (GMT)
commit9fed24c031a885264a9249eed3b6c654c32ce139 (patch)
tree7fde7df9f214ca1e978af8059487d8ef10a782be
parent39b8fb41c50e6ee0aaca81cde2a4dec98d45ef9a (diff)
downloadbusybox-9fed24c031a885264a9249eed3b6c654c32ce139.tar.gz
busybox-9fed24c031a885264a9249eed3b6c654c32ce139.tar.bz2
udhcpc: tweak math shell style with the metric var
Some shells (like dash) are lame and omit the POSIX increment/decrement feature (because it is listed as optional). Tweak the shell script to work in all POSIX variants. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xexamples/udhcp/simple.script3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/udhcp/simple.script b/examples/udhcp/simple.script
index d42f2d3..0397e50 100755
--- a/examples/udhcp/simple.script
+++ b/examples/udhcp/simple.script
@@ -29,7 +29,8 @@ case "$1" in
metric=0
for i in $router ; do
echo "Adding router $i"
- route add default gw $i dev $interface metric $((metric++))
+ route add default gw $i dev $interface metric $metric
+ : $(( metric += 1 ))
done
fi