]> Cypherpunks.ru repositories - govpn.git/commitdiff
Explicitly use local scope of function variables for safety
authorSergey Matveev <stargrave@stargrave.org>
Sun, 7 Feb 2016 13:29:34 +0000 (16:29 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 12 Feb 2016 07:52:32 +0000 (10:52 +0300)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
utils/addroute.sh

index 4c5672b825b47d2cd12deb9d5ab3775033774b04..781505c95d4c123994a00d8ae92da25ed3ae71d9 100755 (executable)
@@ -23,7 +23,7 @@ tear_down_dev() {
 
 
 do_connect() {
-  OLDGW=$(ip route show 0/0 | sed -e 's/^default//')
+  local OLDGW=$(ip route show 0/0 | sed -e 's/^default//')
   ip link set dev $TAPDEV up
   ip addr add $INTERNAL_IP4_ADDRESS dev $TAPDEV
   ip route add $VPNGATEWAY $OLDGW