genconfig: Convert OVPN_ROUTES to array

* Convert to an array to simplify the code.
* This breaks running `ovpn_genconfig` multiple times with the same
  route argument as the array will just grow.  This needs to be fixed in
  the future.
* Recommended way to work around this is to remove ovpn_env.sh.
This commit is contained in:
Kyle Manna
2014-07-09 10:34:39 -07:00
parent 20be0f90a5
commit b9cc5b347a
2 changed files with 7 additions and 20 deletions

View File

@ -21,8 +21,8 @@ fi
if [ "$OVPN_DEFROUTE" != "0" ];then
iptables -t nat -A POSTROUTING -s $OVPN_SERVER -o eth0 -j MASQUERADE
for i in ${OVPN_ROUTES[@]}; do
iptables -t nat -A POSTROUTING -s $i -o eth0 -j MASQUERADE
for i in "${OVPN_ROUTES[@]}"; do
iptables -t nat -A POSTROUTING -s "$i" -o eth0 -j MASQUERADE
done
fi