meshwizard: remove local variable definitions outside functions
authorHannu Nyman <hannu.nyman@iki.fi>
Fri, 9 Dec 2016 15:51:50 +0000 (17:51 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Fri, 9 Dec 2016 15:51:50 +0000 (17:51 +0200)
Adapted from PR #819 by FreifunkUFO

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
contrib/package/meshwizard/Makefile
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_auto-ipv6-dhcpv6-ip.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_lan_ipv6.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd_interface.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh

index b4baab7fa4749347a1c6409d72ea8591f1493146..9ac5a06286e4475ab66d84f96b14f205a9c5b856 100644 (file)
@@ -4,7 +4,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=meshwizard
-PKG_RELEASE:=0.3.1
+PKG_RELEASE:=0.3.2
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index ca623dbcab80ac777eff783d72cbeeb3fcef5e24..9eca11b414538133907c8b95568de34b758f61f3 100755 (executable)
@@ -1,15 +1,15 @@
 #!/bin/sh
 netrenamed=$1
 
-local PREFIX="$(echo $ipv6_prefix| cut -d "/" -f 1| sed 's/::/:/')"
+PREFIX="$(echo $ipv6_prefix| cut -d "/" -f 1| sed 's/::/:/')"
 
 # Get the devices mac address
-local device="$(uci -p/var/state -q get network.$1.ifname)"
+device="$(uci -p/var/state -q get network.$1.ifname)"
 if [ -n "$device" ]; then
-       local MAC="$(ifconfig $netrenamed |grep HWaddr | awk '{ print $5 '})"
+       MAC="$(ifconfig $netrenamed |grep HWaddr | awk '{ print $5 '})"
 else 
-       local MAC="$(cat /sys/class/net/$1/address)"
-       local IPV6_UNIQ="$(echo $MAC | awk -F: '{ print $1$2":"$3$4":"$5$6 }')"
+       MAC="$(cat /sys/class/net/$1/address)"
+       IPV6_UNIQ="$(echo $MAC | awk -F: '{ print $1$2":"$3$4":"$5$6 }')"
 fi
 
 echo "${PREFIX}${IPV6_UNIQ}:1"
index 2f6144b67ffb4871cd56e08c9d4762e9cafea955..1b4f9b16fafd0c8735b70dbce8ffee937982062f 100755 (executable)
@@ -7,10 +7,10 @@
 
 # Setup IPv6 for the lan interface
 
-local ip6addr=""
+ip6addr=""
 if [ "$ipv6_config" = "auto-ipv6-dhcpv6" ]; then
        # get lan mac
-       local device="$(uci -p/var/state -q get network.lan.ifname)"
+       device="$(uci -p/var/state -q get network.lan.ifname)"
        if [ -n "device" ]; then
                ip6addr="$($dir/helpers/gen_auto-ipv6-dhcpv6-ip.sh $device)"
        fi
index 7035e7fb4b3f64cdf5976dec263da0abf8524043..3ad977e265f21b7ac0e729488ef8a1fa965c7a2d 100755 (executable)
@@ -32,7 +32,6 @@ if [ "$netrenamed" = "lan" ]; then
 fi
 
 # Setup IPv6 for the interface
-local ip6addr
 if [ "$ipv6_enabled" = 1 ]; then
        if [ "$ipv6_config" = "auto-ipv6-dhcpv6" ]; then
                ip6addr="$($dir/helpers/gen_auto-ipv6-dhcpv6-ip.sh $netrenamed)"
@@ -82,8 +81,6 @@ if [ "$net_dhcp" == 1 ]; then
        if [ "$supports_vap" = 1 -a "$vap" = 1 -a "$ahdhcp_when_vap" = 1 ]; then
                # VAPs are enabled for this interface, supported and we want to
                # also use DHCP on the adhoc interface
-               local network
-               local mask
                network=${dhcprange%%/*}
                mask=${dhcprange##*/}
                # Divide network size by adding 1 to the netmask
index d212ca4722fc8f5140a901a0a6488f48d87c15cf..01a93874abc06061066267ed6ab3b14f5e084df9 100755 (executable)
@@ -4,7 +4,7 @@
 . /lib/functions.sh
 . $dir/functions.sh
 
-local protocols="4"
+protocols="4"
 if [ "$ipv6_enabled" = 1 ] && [ "$has_ipv6" == "1" ]; then
     protocols="4 6"
 fi
index 8f21893a99373171dc40de4deee1ac8744392aee..59f99bd0a1093f1658b5c79a8e2c5cdc1546948f 100755 (executable)
@@ -7,7 +7,7 @@ net=$1
 . /lib/functions.sh
 . $dir/functions.sh
 
-local protocols="4"
+protocols="4"
 if [ "$ipv6_enabled" = 1 ] && [ "$has_ipv6" == "1" ]; then
        protocols="4 6"
 fi
@@ -61,9 +61,9 @@ for proto in $protocols; do
                # Set Hna entry for ipv6 net for static ipv6 config
                uci -q delete $cfg.${netrenamed}static
                if [ "$ipv6_config" = "static" ]; then
-                       local v6range="$(uci -q get meshwizard.netconfig.$net\_ip6addr)"
-                       local v6net="$(echo $v6range | cut -d '/' -f 1)"
-                       local v6mask="$(echo $v6range | cut -d '/' -f 2)"
+                       v6range="$(uci -q get meshwizard.netconfig.$net\_ip6addr)"
+                       v6net="$(echo $v6range | cut -d '/' -f 1)"
+                       v6mask="$(echo $v6range | cut -d '/' -f 2)"
                        if [ -n "$v6net" ] && [ -n "$v6mask" ]; then
                                uci set $cfg.${netrenamed}static="Hna6"
                                uci set $cfg.${netrenamed}static.netaddr="$v6net"
index 372148997c1d511d1e0152db2c16836556a4b740..450473868e7a8ca4d18025701f61465f11729d19 100755 (executable)
@@ -42,7 +42,7 @@ community="$(uci -q get meshwizard.community.name || uci -q get freifunk.communi
 export community="$community"
 
 # we need a list of widgets later on. It will be populated in read_defaults.sh
-local widgets=""
+widgets=""
 
 # Get a list of networks we need to setup
 networks=$(uci show meshwizard.netconfig | grep -v "netconfig=" | sed -e 's/meshwizard.netconfig\.\(.*\)\_.*/\1/' |sort|uniq)