aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-30 11:38:23 +0000
committerRoy Marples <roy@marples.name>2007-10-30 11:38:23 +0000
commit05f119a78eb803937413cd84f8ec1deb93355586 (patch)
tree885547b9bfbef8231f4dd8b8217134b1e5fa6ad4
parent7d2c240c2584c4cefaebcff86441d31b927293ed (diff)
Embed newlines in __IFS to save our identing
-rw-r--r--net.Linux/bridge.sh7
-rw-r--r--net.Linux/ip6to4.sh11
-rw-r--r--net.Linux/iwconfig.sh18
-rw-r--r--net.Linux/pppd.sh6
-rw-r--r--net.Linux/vlan.sh3
5 files changed, 17 insertions, 28 deletions
diff --git a/net.Linux/bridge.sh b/net.Linux/bridge.sh
index e5b1df65..e2c813a0 100644
--- a/net.Linux/bridge.sh
+++ b/net.Linux/bridge.sh
@@ -39,8 +39,7 @@ bridge_pre_start() {
fi
fi
- local IFS="
-"
+ local IFS="$__IFS"
for x in ${opts}; do
unset IFS
set -- ${x}
@@ -49,12 +48,15 @@ bridge_pre_start() {
set -- "${x}" "${IFACE}" "$@"
brctl "$@"
done
+ unset IFS
if [ -n "${ports}" ] ; then
einfo "Adding ports to ${IFACE}"
eindent
+ local IFS="$__IFS"
for x in ${ports}; do
+ unset IFS
ebegin "${x}"
ifconfig "${x}" promisc up
if ! brctl addif "${IFACE}" "${x}" ; then
@@ -64,6 +66,7 @@ bridge_pre_start() {
fi
eend 0
done
+ unset IFS
eoutdent
fi
) || return 1
diff --git a/net.Linux/ip6to4.sh b/net.Linux/ip6to4.sh
index a4a477a3..df5f5ac5 100644
--- a/net.Linux/ip6to4.sh
+++ b/net.Linux/ip6to4.sh
@@ -56,16 +56,11 @@ ip6to4_start() {
esac
veinfo "IPv4 address on ${host}: ${ip}/${subnet}"
- local OIFS=$IFS SIFS=${IFS-y} ipa= ip6=
- IFS="${IFS}."
- for i in ${ip} ; do
+ local ipa= ip6= IFS="${IFS}."
+ for i in ${ip}; do
ipa="${ipa} ${i}"
done
- if [ "${SIFS}" = "y" ] ; then
- IFS=$OIFS
- else
- unset IFS
- fi
+ unset IFS
eval ip6="$(printf "2002:%02x%02x:%02x%02x::%s" ${ipa} ${suffix})"
veinfo "Derived IPv6 address: ${ip6}"
diff --git a/net.Linux/iwconfig.sh b/net.Linux/iwconfig.sh
index 5f1c1738..65bdb9a6 100644
--- a/net.Linux/iwconfig.sh
+++ b/net.Linux/iwconfig.sh
@@ -118,8 +118,7 @@ iwconfig_user_config() {
[ -z "${var}" ] && var=${IFVAR}
config="$(_get_array "iwconfig_${var}")"
- local IFS="
-"
+ local IFS="$__IFS"
for conf in ${config}; do
unset IFS
if ! eval iwconfig "${IFACE}" "${conf}" ; then
@@ -130,8 +129,7 @@ iwconfig_user_config() {
unset IFS
config="$(_get_array "iwpriv_${var}")"
- local IFS="
-"
+ local IFS="$__IFS"
for conf in ${config}; do
unset IFS
if ! eval iwpriv "${IFACE}" "${conf}" ; then
@@ -480,8 +478,7 @@ iwconfig_scan() {
fi
local blacklist="$(_get_array "blacklist_aps")"
- local IFS="
-"
+ local IFS="$__IFS"
for x in ${blacklist}; do
unset IFS
if [ "${x}" = "${s}" ] ; then
@@ -500,8 +497,7 @@ iwconfig_force_preferred() {
ewarn "Trying to force preferred in case they are hidden"
local pref="$(_get_array "preferred_aps")" ssid=
- local IFS="
-"
+ local IFS="$__IFS"
for ssid in ${pref}; do
unset IFS
local found_AP=false i=0 e=
@@ -526,8 +522,7 @@ iwconfig_force_preferred() {
iwconfig_connect_preferred() {
local ssid= i= mode= mac= enc= freq= chan=
local pref="$(_get_array preferred_aps)"
- local IFS="
-"
+ local IFS="$__IFS"
for ssid in ${pref}; do
unset IFS
i=0
@@ -557,8 +552,7 @@ iwconfig_connect_not_preferred() {
eval e=\$SSID_${i}
if [ -n "${e}" ] ; then
local prefa="$(_get_array preferred_aps)"
- local IFS="
-"
+ local IFS="$__IFS"
for ssid in ${prefa}; do
if [ "${e}" = "${ssid}" ] ; then
pref=true
diff --git a/net.Linux/pppd.sh b/net.Linux/pppd.sh
index 07ac6b1f..4dbad395 100644
--- a/net.Linux/pppd.sh
+++ b/net.Linux/pppd.sh
@@ -124,16 +124,14 @@ pppd_pre_start() {
[ -n "$2" ] && chatopts="${chatopts} -U '$2'"
local chat="$(_get_array "chat_${IFVAR}")"
if [ "${chat}" ] ; then
- local IFS="
-"
+ local IFS="$__IFS"
opts="${opts} connect $(printf "\\'%s\\'" "${chatopts} $(printf "\\'\\\\'\\'%s\\'\\\'' " "$@")")"
unset IFS
fi
# Add plugins
local haspppoa=false haspppoe=false plugins="$(_get_array "plugins_${IFVAR}")"
- local IFS="
-"
+ local IFS="$__IFS"
for i in ${plugins}; do
unset IFS
set -- ${i}
diff --git a/net.Linux/vlan.sh b/net.Linux/vlan.sh
index 23cdf777..2947d261 100644
--- a/net.Linux/vlan.sh
+++ b/net.Linux/vlan.sh
@@ -38,8 +38,7 @@ vlan_pre_start() {
_exists || return 1
local v= x= e=
- local IFS="
-"
+ local IFS="$__IFS"
for v in ${vc}; do
unset IFS
case "${v}" in