treewide: remove bad local shell variable declarations

Local variable declarations outside of functions are illegal since the Busybox
update to v1.25.0, therfore remove them from the appropriate places.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2016-09-24 14:30:24 +02:00
parent df9efc9497
commit 1c09849f6c
7 changed files with 16 additions and 21 deletions

View file

@ -4,7 +4,7 @@
. /lib/functions.sh . /lib/functions.sh
local rfkill_state=0 rfkill_state=0
wifi_rfkill_set() { wifi_rfkill_set() {
uci set wireless.$1.disabled=$rfkill_state uci set wireless.$1.disabled=$rfkill_state

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
local ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)" ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
local spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)" spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then
logger -t migrate-shadow "Moving root password hash into shadow database" logger -t migrate-shadow "Moving root password hash into shadow database"

View file

@ -3,8 +3,8 @@
# Copyright (C) 2010 OpenWrt.org # Copyright (C) 2010 OpenWrt.org
# #
local dev="$(uci -q get network.@switch_vlan[0].device)" dev="$(uci -q get network.@switch_vlan[0].device)"
local vlan="$(uci -q get network.@switch_vlan[0].vlan)" vlan="$(uci -q get network.@switch_vlan[0].vlan)"
if [ "$dev" = "rtl8366s" ] && [ "$vlan" = 0 ]; then if [ "$dev" = "rtl8366s" ] && [ "$vlan" = 0 ]; then
logger -t vlan-migration "VLAN 0 is invalid for RTL8366s, changing to 1" logger -t vlan-migration "VLAN 0 is invalid for RTL8366s, changing to 1"

View file

@ -175,9 +175,9 @@ detect_by_model() {
} }
local model="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)" model="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)"
local boardtype="$(nvram get boardtype)" boardtype="$(nvram get boardtype)"
local boardnum="$(nvram get boardnum)" boardnum="$(nvram get boardnum)"
board_config_update board_config_update

View file

@ -8,12 +8,12 @@ uci show network | grep "\.vlan=0"
logger -t network "network config is invalid, creating new one" logger -t network "network config is invalid, creating new one"
local lan_proto="$(uci -q get network.lan.proto)" lan_proto="$(uci -q get network.lan.proto)"
local lan_ipaddr="$(uci -q get network.lan.ipaddr)" lan_ipaddr="$(uci -q get network.lan.ipaddr)"
local lan_netmask="$(uci -q get network.lan.netmask)" lan_netmask="$(uci -q get network.lan.netmask)"
local wan_proto="$(uci -q get network.wan.proto)" wan_proto="$(uci -q get network.wan.proto)"
local wan_ipaddr="$(uci -q get network.wan.ipaddr)" wan_ipaddr="$(uci -q get network.wan.ipaddr)"
local wan_netmask="$(uci -q get network.wan.netmask)" wan_netmask="$(uci -q get network.wan.netmask)"
echo "" > /etc/config/network echo "" > /etc/config/network
config_generate config_generate

View file

@ -16,7 +16,6 @@
include /lib/network include /lib/network
scan_interfaces scan_interfaces
local led
config_load system config_load system
config_get led led_dsl sysfs config_get led led_dsl sysfs
if [ -n "$led" ]; then if [ -n "$led" ]; then
@ -28,18 +27,14 @@ if [ -n "$led" ]; then
esac esac
fi fi
local interfaces=`ubus list network.interface.\* | cut -d"." -f3` interfaces=`ubus list network.interface.\* | cut -d"." -f3`
local ifc
for ifc in $interfaces; do for ifc in $interfaces; do
local up
json_load "$(ifstatus $ifc)" json_load "$(ifstatus $ifc)"
json_get_var up up json_get_var up up
local auto
config_get_bool auto "$ifc" auto 1 config_get_bool auto "$ifc" auto 1
local proto
json_get_var proto proto json_get_var proto proto
if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then

View file

@ -10,7 +10,7 @@
# This script sets system defaults for the hardware on firstboot # This script sets system defaults for the hardware on firstboot
# #
local hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo` hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
wrt350nv2_default() { wrt350nv2_default() {
# leds # leds