summaryrefslogtreecommitdiff
path: root/package/base-files/default
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-07-30 13:21:18 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-07-30 13:21:18 +0000
commitfd40fb97f848901b4d3c197d0e83e95b01312f9a (patch)
treea324045a6a2e62a36e0343974d5069952c242ea8 /package/base-files/default
parent159377985a06e06657d113687835f82f46a2c437 (diff)
fix more instances of '' abuse
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4326 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/default')
-rw-r--r--package/base-files/default/etc/hotplug.d/net/10-net4
-rwxr-xr-xpackage/base-files/default/lib/network/config.sh16
-rwxr-xr-xpackage/base-files/default/sbin/ifdown14
-rwxr-xr-xpackage/base-files/default/sbin/wifi12
4 files changed, 23 insertions, 23 deletions
diff --git a/package/base-files/default/etc/hotplug.d/net/10-net b/package/base-files/default/etc/hotplug.d/net/10-net
index d5b7f6b0fa..72146a1d78 100644
--- a/package/base-files/default/etc/hotplug.d/net/10-net
+++ b/package/base-files/default/etc/hotplug.d/net/10-net
@@ -8,8 +8,8 @@ addif() {
# find all vlan configurations for this interface and set them up as well
for ifc in $interfaces; do
- config_get type "$ifc" type
- case "$type" in
+ config_get iftype "$ifc" type
+ case "$iftype" in
bridge) config_get ifs "$ifc" ifnames;;
*) config_get ifs "$ifc" ifname;;
esac
diff --git a/package/base-files/default/lib/network/config.sh b/package/base-files/default/lib/network/config.sh
index 59ec84aba8..76db09de15 100755
--- a/package/base-files/default/lib/network/config.sh
+++ b/package/base-files/default/lib/network/config.sh
@@ -4,11 +4,11 @@
# DEBUG="echo"
find_config() {
- local type iface ifn
+ local iftype iface ifn
for ifn in $interfaces; do
- config_get type "$ifn" type
+ config_get iftype "$ifn" type
config_get iface "$ifn" ifname
- case "$type" in
+ case "$iftype" in
bridge)
config_get iface "$ifn" ifnames
;;
@@ -25,15 +25,15 @@ find_config() {
}
scan_interfaces() {
- local mode type iface
+ local mode iftype iface
interfaces=
config_cb() {
- config_get type "$CONFIG_SECTION" TYPE
- case "$type" in
+ config_get iftype "$CONFIG_SECTION" TYPE
+ case "$iftype" in
interface)
- config_get type "$CONFIG_SECTION" type
+ config_get iftype "$CONFIG_SECTION" type
config_get mode "$CONFIG_SECTION" proto
- case "$type" in
+ case "$iftype" in
bridge)
config_get iface "$CONFIG_SECTION" ifname
iface="${iface:-br-$CONFIG_SECTION}"
diff --git a/package/base-files/default/sbin/ifdown b/package/base-files/default/sbin/ifdown
index 7debb9559f..1334ee8218 100755
--- a/package/base-files/default/sbin/ifdown
+++ b/package/base-files/default/sbin/ifdown
@@ -6,14 +6,14 @@
include network
scan_interfaces
-debug "### ifdown $type ###"
-type=$1
+cfg=$1
+debug "### ifdown $cfg ###"
-config_get proto "$type" proto
+config_get proto "$cfg" proto
[ -z "$proto" ] && { echo "interface not found."; exit; }
# kill active ppp daemon
-pid="$(cat /var/run/ppp-${type}.pid 2>/dev/null)"
+pid="$(cat /var/run/ppp-${cfg}.pid 2>/dev/null)"
[ -n "$pid" -a -d "/proc/$pid" ] && {
kill $pid
sleep 1
@@ -21,14 +21,14 @@ pid="$(cat /var/run/ppp-${type}.pid 2>/dev/null)"
}
# kill any other process associated with the interface
-config_get ifname "$type" ifname
+config_get ifname "$cfg" ifname
pid="$(cat /var/run/${ifname}.pid 2>/dev/null)"
[ -n "$pid" -a -d "/proc/$pid" ] && kill -9 $pid
-config_get ifname "$type" ifname
+config_get ifname "$cfg" ifname
ifconfig "$ifname" >/dev/null 2>/dev/null && {
ifconfig "$ifname" 0.0.0.0 down
- config_get iftype "$type" type
+ config_get iftype "$cfg" type
[ "$iftype" = "bridge" ] && brctl delbr "$ifname"
}
diff --git a/package/base-files/default/sbin/wifi b/package/base-files/default/sbin/wifi
index f1ac94fa3a..b228eed8a0 100755
--- a/package/base-files/default/sbin/wifi
+++ b/package/base-files/default/sbin/wifi
@@ -33,12 +33,12 @@ config_load wireless
include wifi
for device in $DEVICES; do (
- config_get type "$device" type
- eval "type setup_$type" 2>/dev/null >/dev/null && {
- eval "scan_$type '$device'"
- eval "setup_$type '$device'" && {
+ config_get iftype "$device" type
+ eval "type setup_$iftype" 2>/dev/null >/dev/null && {
+ eval "scan_$iftype '$device'"
+ eval "setup_$iftype '$device'" && {
# TODO: set up network settings
/bin/true
- } || echo "$device($type): Setup failed" || true
- } || echo "$device($type): Interface type not supported"
+ } || echo "$device($iftype): Setup failed" || true
+ } || echo "$device($iftype): Interface type not supported"
); done