From: Mike Frysinger Date: Wed, 27 Feb 2013 06:05:34 +0000 (-0500) Subject: udhcpc: tweak math shell style with the metric var X-Git-Tag: 1_22_0~287 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9fed24c031a885264a9249eed3b6c654c32ce139;p=oweals%2Fbusybox.git 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 --- diff --git a/examples/udhcp/simple.script b/examples/udhcp/simple.script index d42f2d3d5..0397e506c 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