Browse Source

work around for stupid bash syntax limitations on android

Fabio Arnold 9 years ago
parent
commit
e8b1f7b744
1 changed files with 2 additions and 1 deletions
  1. 2 1
      assets/payload/redirect-ports.sh

+ 2 - 1
assets/payload/redirect-ports.sh

@@ -9,7 +9,8 @@ origin=(       7     21    80    443   137   138   137   139   22    23   )
 destination=( 28144 28169 28217 28580 28274 28275 28274 28276 28159 28160 ) # simply offset by 1024 + 27113
 length=${#protocol[@]} # count protocol elements
 
-for (( i=0; i<$length; i++ ))
+# for (( i=0; i<$length; i++ ))
+for i in `seq 0 9` # fix for android's annoyingly limited bash
 do
 	# echo ${protocol[$i]} ${origin[$i]} ${destination[$i]} # debug
 	iptables -t nat -A PREROUTING -p ${protocol[$i]} --dport ${origin[$i]} -j REDIRECT --to-ports ${destination[$i]}