more whitespace cleanup
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
@@ -21,7 +21,7 @@ apipa_start()
|
||||
local iface="$1" i1= i2= addr= i=0
|
||||
|
||||
_exists true || return 1
|
||||
|
||||
|
||||
einfo "Searching for free addresses in 169.254.0.0/16"
|
||||
eindent
|
||||
|
||||
|
@@ -19,7 +19,7 @@ arping_address()
|
||||
esac
|
||||
|
||||
# We need to bring the interface up to test
|
||||
_exists "${iface}" || return 1
|
||||
_exists "${iface}" || return 1
|
||||
_up "${iface}"
|
||||
|
||||
eval w=\$arping_wait_${IFVAR}
|
||||
@@ -43,7 +43,7 @@ arping_address()
|
||||
sed -n -e 'y/abcdef/ABCDEF/' -e 's/.*\[\([^]]*\)\].*/\1/p')"
|
||||
fi
|
||||
[ -z "${foundmac}" ] && return 1
|
||||
|
||||
|
||||
if [ -n "${mac}" ]; then
|
||||
if [ "${mac}" != "${foundmac}" ]; then
|
||||
vewarn "Found ${ip} but MAC ${foundmac} does not match"
|
||||
@@ -74,7 +74,7 @@ arping_start()
|
||||
fi
|
||||
|
||||
eindent
|
||||
|
||||
|
||||
for x in ${gateways}; do
|
||||
local IFS=,
|
||||
set -- ${x}
|
||||
@@ -119,7 +119,7 @@ arping_start()
|
||||
fi
|
||||
done
|
||||
unset IFS
|
||||
|
||||
|
||||
_load_config
|
||||
return 0
|
||||
fi
|
||||
|
@@ -115,7 +115,7 @@ bonding_pre_start()
|
||||
|
||||
bonding_stop()
|
||||
{
|
||||
_is_bond || return 0
|
||||
_is_bond || return 0
|
||||
|
||||
local slaves= s=
|
||||
slaves=$( \
|
||||
|
@@ -17,7 +17,7 @@ br2684ctl_depend()
|
||||
}
|
||||
|
||||
_config_vars="$_config_vars bridge bridge_add brctl"
|
||||
|
||||
|
||||
br2684ctl_pre_start()
|
||||
{
|
||||
local opts=
|
||||
@@ -40,7 +40,7 @@ br2684ctl_pre_start()
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
einfo "Starting RFC 2684 Bridge control on ${IFACE}"
|
||||
start-stop-daemon --start --exec $(_br2684ctl) --background \
|
||||
--make-pidfile --pidfile "/var/run/br2684ctl-${IFACE}.pid" \
|
||||
@@ -52,7 +52,7 @@ br2684ctl_post_stop()
|
||||
{
|
||||
local pidfile="/var/run/br2684ctl-${IFACE}.pid"
|
||||
[ -e "${pidfile}" ] || return 0
|
||||
|
||||
|
||||
einfo "Stopping RFC 2684 Bridge control on ${IFACE}"
|
||||
start-stop-daemon --stop --quiet --pidfile "${pidfile}"
|
||||
eend $?
|
||||
|
@@ -38,13 +38,13 @@ bridge_pre_start()
|
||||
local opts="$(_get_array "brctl_${IFVAR}")"
|
||||
# brif is used for dynamic add
|
||||
eval brif=\$bridge_add_${IFVAR}
|
||||
|
||||
|
||||
# we need a way to if the bridge exists in a variable name, not just the
|
||||
# contents of a variable. Eg if somebody has only bridge_add_eth0='br0',
|
||||
# with no other lines mentioning br0.
|
||||
eval bridge_unset=\${bridge_${IFVAR}-y\}
|
||||
eval brctl_unset=\${brctl_${IFVAR}-y\}
|
||||
|
||||
|
||||
if [ -z "${brif}" -a "${brctl_unset}" == 'y' ]; then
|
||||
if [ -z "${ports}" -a "${bridge_unset}" == "y" ]; then
|
||||
#eerror "Misconfigured static bridge detected (see net.example)"
|
||||
@@ -186,6 +186,6 @@ bridge_post_stop()
|
||||
brctl delbr "${iface}"
|
||||
eend $?
|
||||
fi
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ _config_vars="$_config_vars ccwgroup"
|
||||
|
||||
ccwgroup_depend()
|
||||
{
|
||||
before interface
|
||||
before interface
|
||||
}
|
||||
|
||||
ccwgroup_pre_start()
|
||||
@@ -42,7 +42,7 @@ ccwgroup_pre_stop()
|
||||
{
|
||||
# Erase any existing ccwgroup to be safe
|
||||
service_set_value ccwgroup_device ""
|
||||
|
||||
|
||||
[ ! -L /sys/class/net/"${FACE}"/driver ] && return 0
|
||||
local driver="$(readlink /sys/class/net/"${IFACE}"/driver)"
|
||||
case "${diver}" in
|
||||
@@ -59,7 +59,7 @@ ccwgroup_post_stop()
|
||||
{
|
||||
local device="$(service_get_value ccwgroup_device)"
|
||||
[ -z "${device}" ] && return 0
|
||||
|
||||
|
||||
einfo "Disabling ccwgroup on ${iface}"
|
||||
echo "0" >/sys/devices/qeth/"${device}"/online
|
||||
echo "1" >/sys/devices/qeth/"${device}"/ungroup
|
||||
|
@@ -97,7 +97,7 @@ clip_pre_start()
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
local started_here=
|
||||
if ! are_atmclip_svcs_running; then
|
||||
atmclip_svcs_start || return 1
|
||||
|
@@ -139,7 +139,7 @@ _add_address()
|
||||
return 0
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
case "$1" in
|
||||
*:*) ifconfig "${IFACE}" inet6 add "$@"; return $?;;
|
||||
esac
|
||||
|
||||
@@ -225,7 +225,7 @@ _delete_addresses()
|
||||
while true; do
|
||||
local addr=$(_get_inet_address)
|
||||
[ -z "${addr}" ] && break
|
||||
|
||||
|
||||
if [ "${addr}" = "127.0.0.1/8" ]; then
|
||||
# Don't delete the loopback address
|
||||
[ "${IFACE}" = "lo" -o "${IFACE}" = "lo0" ] && break
|
||||
@@ -246,7 +246,7 @@ _delete_addresses()
|
||||
einfo "${addr}"
|
||||
ifconfig "${IFACE}" inet6 del "${addr}"
|
||||
done
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -57,7 +57,7 @@ ifplugd_pre_start()
|
||||
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
||||
elif [ ${timeout} -lt 0 ]; then
|
||||
einfo "Backgrounding ..."
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
veinfo "Waiting for ${IFACE} to be marked as started"
|
||||
@@ -84,7 +84,7 @@ ifplugd_stop()
|
||||
|
||||
local pidfile="/var/run/ifplugd.${IFACE}.pid"
|
||||
[ ! -e "${pidfile}" ] && return 0
|
||||
|
||||
|
||||
ebegin "Stopping ifplugd on ${IFACE}"
|
||||
start-stop-daemon --stop --quiet --exec /usr/sbin/ifplugd \
|
||||
--pidfile "${pidfile}" --signal QUIT
|
||||
|
@@ -50,7 +50,7 @@ ifwatchd_stop()
|
||||
-- -c "${RC_LIBEXECDIR}/sh/ifwatchd-carrier.sh" \
|
||||
-n "${RC_LIBEXECDIR}/sh/ifwatchd-nocarrier.sh" "${IFACE}" \
|
||||
|| return 0
|
||||
|
||||
|
||||
ebegin "Stopping ifwatchd on" "${IFACE}"
|
||||
start-stop-daemon --stop --exec /usr/sbin/ifwatchd \
|
||||
-- -c "${RC_LIBEXECDIR}/sh/ifwatchd-carrier.sh" \
|
||||
|
@@ -56,7 +56,7 @@ ip6to4_start()
|
||||
[ ${i} -lt 32 ] && continue
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
veinfo "IPv4 address on ${host}: ${ip}/${subnet}"
|
||||
local ipa= ip6= IFS="${IFS}."
|
||||
for i in ${ip}; do
|
||||
@@ -87,7 +87,7 @@ ip6to4_start()
|
||||
eend $? || return 1
|
||||
_up
|
||||
fi
|
||||
|
||||
|
||||
# Now apply our config
|
||||
eval config_${config_index}=\'"${new}"\'
|
||||
config_index=$((${config_index} - 1))
|
||||
|
@@ -117,14 +117,14 @@ _add_address()
|
||||
shift; shift; shift
|
||||
set -- "${one}/$(_netmask2cidr "${three}")" "$@"
|
||||
fi
|
||||
|
||||
|
||||
# tunnel keyword is 'peer' in iproute2, but 'pointopoint' in ifconfig.
|
||||
if [ "$2" = "pointopoint" ]; then
|
||||
local one="$1"
|
||||
shift; shift
|
||||
set -- "${one}" "peer" "$@"
|
||||
fi
|
||||
|
||||
|
||||
# Always scope lo addresses as host unless specified otherwise
|
||||
if [ "${IFACE}" = "lo" ]; then
|
||||
set -- "$@" "scope" "host"
|
||||
@@ -162,7 +162,7 @@ _add_route()
|
||||
set -- "${one}" "${two}" via "$@"
|
||||
fi
|
||||
|
||||
local cmd= have_metric=false
|
||||
local cmd= have_metric=false
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
metric) cmd="${cmd} $1"; have_metric=true;;
|
||||
|
@@ -477,7 +477,7 @@ iwconfig_defaults()
|
||||
#ifconfig "${iface}" txpower 100 2>/dev/null
|
||||
ifconfig "${IFACE}" bssid -
|
||||
ifconfig "${IFACE}" ssid -
|
||||
ifconfig "${IFACE}" wepkey 1:- wepkey 2:- wepkey 3:- wepkey 4:-
|
||||
ifconfig "${IFACE}" wepkey 1:- wepkey 2:- wepkey 3:- wepkey 4:-
|
||||
ifconfig "${IFACE}" authmode open
|
||||
ifconfig "${IFACE}" -mediaopt adhoc
|
||||
ifconfig "${IFACE}" -mediaopt hostap
|
||||
@@ -563,8 +563,8 @@ iwconfig_pre_start()
|
||||
return 0
|
||||
fi
|
||||
|
||||
iwconfig_defaults
|
||||
iwconfig_user_config
|
||||
iwconfig_defaults
|
||||
iwconfig_user_config
|
||||
|
||||
# Set the base metric to be 2000
|
||||
metric=2000
|
||||
|
@@ -47,7 +47,7 @@ _get_ssid()
|
||||
|
||||
_get_ap_mac_address()
|
||||
{
|
||||
local mac="$(iwgetid --raw --ap "${IFACE}")"
|
||||
local mac="$(iwgetid --raw --ap "${IFACE}")"
|
||||
case "${mac}" in
|
||||
"00:00:00:00:00:00") return 1;;
|
||||
"44:44:44:44:44:44") return 1;;
|
||||
@@ -163,7 +163,7 @@ iwconfig_setup_specific()
|
||||
local key=$(iwconfig_get_wep_key)
|
||||
|
||||
iwconfig_set_mode "${mode}"
|
||||
|
||||
|
||||
# Now set the key
|
||||
if ! eval iwconfig "${IFACE}" key "${key}"; then
|
||||
if [ "${key}" != "off" ]; then
|
||||
@@ -185,10 +185,10 @@ iwconfig_setup_specific()
|
||||
ewarn "${IFACE} does not support setting the channel to \"${channel:-3}\""
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Finally apply the user Config
|
||||
iwconfig_user_config
|
||||
|
||||
|
||||
iwconfig_report
|
||||
return 0
|
||||
}
|
||||
@@ -226,7 +226,7 @@ iwconfig_wait_for_association()
|
||||
/proc/net/wireless)" != "0" ] && return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
sleep 1
|
||||
[ ${timeout} -eq 0 ] && continue
|
||||
i=$((${i} + 1))
|
||||
@@ -281,7 +281,7 @@ iwconfig_associate()
|
||||
iwconfig "${IFACE}" freq "${freq}"
|
||||
fi
|
||||
[ -n "${mac}" ] && iwconfig "${IFACE}" ap "${mac}"
|
||||
|
||||
|
||||
# Finally apply the user Config
|
||||
iwconfig_user_config
|
||||
|
||||
@@ -377,10 +377,10 @@ iwconfig_scan()
|
||||
for line; do
|
||||
case "${line}" in
|
||||
*Address:*)
|
||||
APS=$((${APS} + 1))
|
||||
APS=$((${APS} + 1))
|
||||
eval MAC_${APS}="\""$(echo "${line#*: }" | tr '[:lower:]' '[:upper:]')"\""
|
||||
eval QUALITY_${APS}=0
|
||||
;;
|
||||
;;
|
||||
*ESSID:*)
|
||||
x=${line#*\"}
|
||||
x=${x%*\"}
|
||||
@@ -455,7 +455,7 @@ iwconfig_scan()
|
||||
eval a=\$QUALITY_${i}
|
||||
eval b=\$QUALITY_${k}
|
||||
local u=${k}
|
||||
# We need to split this into two tests, otherwise bash errors
|
||||
# We need to split this into two tests, otherwise bash errors
|
||||
[ -n "${a}" -a -n "${b}" ] && [ "${a}" -lt "${b}" ] && u=${i}
|
||||
unset MAC_${u} SSID_${u} MODE_${u} CHAN_${u} QUALITY_${u} ENC_${u}
|
||||
fi
|
||||
@@ -581,7 +581,7 @@ iwconfig_connect_not_preferred()
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if ! ${pref}; then
|
||||
SSID=${e}
|
||||
eval mode=\$MODE_${i}
|
||||
@@ -711,10 +711,10 @@ iwconfig_pre_start()
|
||||
# wait if our scan returns nothing
|
||||
LC_ALL=C iwconfig "${IFACE}" | sed -e '1d' | grep -q "Tx-Power=off"
|
||||
local txpowerwasoff=$?
|
||||
|
||||
|
||||
iwconfig_defaults
|
||||
iwconfig_user_config
|
||||
|
||||
|
||||
# Set the base metric to be 2000
|
||||
metric=2000
|
||||
|
||||
|
@@ -24,7 +24,7 @@ macchanger_pre_start()
|
||||
|
||||
# The interface needs to be up for macchanger to work most of the time
|
||||
_down
|
||||
|
||||
|
||||
mac=$(echo "${mac}" | tr '[:upper:]' '[:lower:]')
|
||||
local hex="[0-9a-f][0-9a-f]"
|
||||
case "${mac}" in
|
||||
|
@@ -59,7 +59,7 @@ netplugd_pre_start()
|
||||
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
||||
elif [ ${timeout} -lt 0 ]; then
|
||||
einfo "Backgrounding ..."
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
veinfo "Waiting for ${IFACE} to be marked as started"
|
||||
@@ -86,7 +86,7 @@ netplugd_stop()
|
||||
|
||||
local pidfile="/var/run/netplugd-${IFACE}.pid"
|
||||
[ ! -e "${pidfile}" ] && return 0
|
||||
|
||||
|
||||
ebegin "Stopping netplug on" "${IFACE}"
|
||||
start-stop-daemon --stop --quiet --exec /sbin/netplugd \
|
||||
--pidfile "${pidfile}"
|
||||
|
@@ -31,7 +31,7 @@ pppd_pre_start()
|
||||
if yesno ${IN_BACKGROUND}; then
|
||||
local config=
|
||||
eval config=\$config_${IFVAR}
|
||||
# If no config for ppp then don't default to DHCP
|
||||
# If no config for ppp then don't default to DHCP
|
||||
if [ -z "${config}" ]; then
|
||||
eval config_${IFVAR}=null
|
||||
fi
|
||||
@@ -39,7 +39,7 @@ pppd_pre_start()
|
||||
fi
|
||||
|
||||
local link= i= unit="${IFACE#ppp}" opts=
|
||||
|
||||
|
||||
# PPP requires a link to communicate over - normally a serial port
|
||||
# PPPoE communicates over Ethernet
|
||||
# PPPoA communicates over ATM
|
||||
@@ -92,7 +92,7 @@ pppd_pre_start()
|
||||
&& [ -n "${password}" -o -z "${passwordset}" ]; then
|
||||
opts="plugin passwordfd.so ${opts} passwordfd 0"
|
||||
fi
|
||||
|
||||
|
||||
if ! ${hasdefaultmetric}; then
|
||||
local m=
|
||||
eval m=\$metric_${IFVAR}
|
||||
@@ -122,7 +122,7 @@ pppd_pre_start()
|
||||
|
||||
# Set unit
|
||||
opts="unit ${unit} ${opts}"
|
||||
|
||||
|
||||
# Setup connect script
|
||||
local chatprog="/usr/sbin/chat -e -E -v" phone=
|
||||
eval phone=\$phone_number_${IFVAR}
|
||||
|
@@ -35,7 +35,7 @@ pump_start()
|
||||
|
||||
ebegin "Running pump"
|
||||
eval pump "${args}"
|
||||
eend $? || return 1
|
||||
eend $? || return 1
|
||||
|
||||
_show_address
|
||||
return 0
|
||||
@@ -48,7 +48,7 @@ pump_stop()
|
||||
start-stop-daemon --quiet --test --stop --exec /sbin/pump || return 0
|
||||
|
||||
# Check that pump is running on the interface
|
||||
if ! pump --status --interface "${IFACE}" >/dev/null 2>&1; then
|
||||
if ! pump --status --interface "${IFACE}" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
@@ -80,10 +80,10 @@ _system_nis()
|
||||
|
||||
eval servers=\$nis_servers_${IFVAR}
|
||||
[ -z "${servers}" ] && servers=${nis_servers}
|
||||
|
||||
|
||||
eval domain=\$nis_domain_${IFVAR}
|
||||
[ -z "${domain}" ] && domain=${nis_domain}
|
||||
|
||||
|
||||
[ -z "${servers}" -a -z "${domain}" ] && return 0
|
||||
|
||||
buffer="# Generated by net-scripts for interface ${iface}\n"
|
||||
@@ -110,8 +110,8 @@ _system_nis()
|
||||
system_pre_start()
|
||||
{
|
||||
_system_dns
|
||||
_system_ntp
|
||||
_system_nis
|
||||
_system_ntp
|
||||
_system_nis
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ vlan_post_start()
|
||||
local vlans=
|
||||
eval vlans=\$vlans_${IFVAR}
|
||||
[ -z "${vlans}" ] && return 0
|
||||
|
||||
|
||||
_check_vlan || return 1
|
||||
_exists || return 1
|
||||
|
||||
@@ -95,7 +95,7 @@ vlan_post_start()
|
||||
start
|
||||
) || mark_service_stopped "net.${ifname}"
|
||||
done
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -149,7 +149,7 @@ wpa_supplicant_pre_start()
|
||||
if [ -z "${wpac}" ]; then
|
||||
if service_started devd; then
|
||||
ebegin "Backgrounding ..."
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
@@ -167,7 +167,7 @@ wpa_supplicant_pre_start()
|
||||
-P "/var/run/wpa_cli-${IFACE}.pid" -B
|
||||
if eend $?; then
|
||||
ebegin "Backgrounding ..."
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# wpa_cli failed to start? OK, error here
|
||||
|
Reference in New Issue
Block a user