Massive whitespace cleanup
This commit is contained in:
@@ -42,7 +42,7 @@ ipfw() {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
# Load the kernel module
|
# Load the kernel module
|
||||||
if ! sysctl net.inet.ip.fw.enable=1 >/dev/null 2>/dev/null; then
|
if ! sysctl net.inet.ip.fw.enable=1 >/dev/null 2>&1; then
|
||||||
if ! kldload ipfw; then
|
if ! kldload ipfw; then
|
||||||
eend 1 "Unable to load firewall module"
|
eend 1 "Unable to load firewall module"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ name="Network Time Protocol Daemon"
|
|||||||
depend() {
|
depend() {
|
||||||
use dns
|
use dns
|
||||||
need localmount
|
need localmount
|
||||||
after bootmisc ntpdate ntp-client
|
after bootmisc ntp-client
|
||||||
}
|
}
|
||||||
|
|
||||||
start_pre() {
|
start_pre() {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
command=/usr/sbin/sshd
|
command=/usr/sbin/sshd
|
||||||
command_args=${sshd_args}
|
command_args=${sshd_args}
|
||||||
pidfile=/var/run/sshd.pid
|
pidfile=/var/run/sshd.pid
|
||||||
required_files=/etc/sshd/sshd_config
|
required_files=/etc/ssh/sshd_config
|
||||||
required_dirs=/var/empty
|
required_dirs=/var/empty
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ if [ -n "${mnt}" -a -w "${RC_LIBDIR}" ] ; then
|
|||||||
f_opts="-m -c"
|
f_opts="-m -c"
|
||||||
[ "${RC_UNAME}" = "Linux" ] && f_opts="-c"
|
[ "${RC_UNAME}" = "Linux" ] && f_opts="-c"
|
||||||
if [ -n "$(fuser ${f_opts} "${svcdir}" 2>/dev/null)" ]; then
|
if [ -n "$(fuser ${f_opts} "${svcdir}" 2>/dev/null)" ]; then
|
||||||
fuser -k ${f_opts} "${svcdir}" 1>/dev/null 2>/dev/null
|
fuser -k ${f_opts} "${svcdir}" >/dev/null 2>&1
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
cp -p "${RC_SVCDIR}"/deptree "${RC_SVCDIR}"/depconfig \
|
cp -p "${RC_SVCDIR}"/deptree "${RC_SVCDIR}"/depconfig \
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ iwconfig_get_wep_status() {
|
|||||||
|
|
||||||
_iwconfig_get() {
|
_iwconfig_get() {
|
||||||
LC_ALL=C ifconfig "${IFACE}" | \
|
LC_ALL=C ifconfig "${IFACE}" | \
|
||||||
sed -n -e "s/^[[:space:]]*ssid \(.*\) channel \([0-9]*\) bssid \(..:..:..:..:..:..\)\$/\\$1/p"
|
sed -n -e "s/^[[:space:]]*ssid \(.*\) channel \([0-9]*\).* bssid \(..:..:..:..:..:..\)\$/\\$1/p"
|
||||||
}
|
}
|
||||||
|
|
||||||
_get_ssid() {
|
_get_ssid() {
|
||||||
|
|||||||
@@ -28,8 +28,9 @@ apipa_depend() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_random() {
|
_random() {
|
||||||
if [ -n "${BASH}" ] ; then
|
local r=${RANDOM}
|
||||||
echo "${RANDOM}"
|
if [ -n "${r}" ]; then
|
||||||
|
echo "${r}"
|
||||||
else
|
else
|
||||||
uuidgen | sed -n -e 's/[^[:digit:]]//g' -e 's/\(^.\{1,7\}\).*/\1/p'
|
uuidgen | sed -n -e 's/[^[:digit:]]//g' -e 's/\(^.\{1,7\}\).*/\1/p'
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -35,21 +35,21 @@ ifplugd_depend() {
|
|||||||
ifplugd_pre_start() {
|
ifplugd_pre_start() {
|
||||||
local pidfile="/var/run/ifplugd.${IFACE}.pid" timeout= args=
|
local pidfile="/var/run/ifplugd.${IFACE}.pid" timeout= args=
|
||||||
|
|
||||||
# We don't start netplug if we're being called from the background
|
# We don't start ifplugd if we're being called from the background
|
||||||
yesno ${IN_BACKGROUND} && return 0
|
yesno ${IN_BACKGROUND} && return 0
|
||||||
|
|
||||||
_exists || return 0
|
_exists || return 0
|
||||||
|
|
||||||
# We need a valid MAC address
|
# We need a valid MAC address
|
||||||
# It's a basic test to ensure it's not a virtual interface
|
# It's a basic test to ensure it's not a virtual interface
|
||||||
if ! _get_mac_address >/dev/null 2>/dev/null ; then
|
if ! _get_mac_address >/dev/null 2>&1; then
|
||||||
vewarn "netplug only works on interfaces with a valid MAC address"
|
vewarn "ifplugd only works on interfaces with a valid MAC address"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We don't work on bonded, bridges, tun/tap, vlan or wireless
|
# We don't work on bonded, bridges, tun/tap, vlan or wireless
|
||||||
for f in bond bridge tuntap vlan wireless; do
|
for f in bond bridge tuntap vlan wireless; do
|
||||||
if type "_is_${f}" >/dev/null 2>/dev/null ; then
|
if type "_is_${f}" >/dev/null 2>&1; then
|
||||||
if _is_${f}; then
|
if _is_${f}; then
|
||||||
veinfo "netplug does not work with" "${f}"
|
veinfo "netplug does not work with" "${f}"
|
||||||
return 0
|
return 0
|
||||||
@@ -74,13 +74,13 @@ ifplugd_pre_start() {
|
|||||||
eval timeout=\$plug_timeout_${IFVAR}
|
eval timeout=\$plug_timeout_${IFVAR}
|
||||||
[ -z "${timeout}" ] && timeout=-1
|
[ -z "${timeout}" ] && timeout=-1
|
||||||
if [ ${timeout} -eq 0 ]; then
|
if [ ${timeout} -eq 0 ]; then
|
||||||
ewarn "WARNING: infinite timeout set for" "${IFACE}" "to come up"
|
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
||||||
elif [ ${timeout} -lt 0 ]; then
|
elif [ ${timeout} -lt 0 ]; then
|
||||||
einfo "Backgrounding ..."
|
einfo "Backgrounding ..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
veinfo "Waiting for" "${IFACE}" "to be marked as started"
|
veinfo "Waiting for ${IFACE} to be marked as started"
|
||||||
|
|
||||||
local i=0
|
local i=0
|
||||||
while true; do
|
while true; do
|
||||||
@@ -89,12 +89,12 @@ ifplugd_pre_start() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
[ ${timeout} -eq 0 ]] && continue
|
[ ${timeout} -eq 0 ] && continue
|
||||||
i=$((${i} + 1))
|
i=$((${i} + 1))
|
||||||
[ ${i} -ge ${timeout} ] && break
|
[ ${i} -ge ${timeout} ] && break
|
||||||
done
|
done
|
||||||
|
|
||||||
eend 1 "Failed to configure" "${IFACE}" "in the background"
|
eend 1 "Failed to configure ${IFACE} in the background"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ iwconfig_associate() {
|
|||||||
|
|
||||||
ebegin "Connecting to \"${SSID}\" in ${mode} mode ${w}"
|
ebegin "Connecting to \"${SSID}\" in ${mode} mode ${w}"
|
||||||
|
|
||||||
if [ "${SSID}" != "any" ] && type preassociate >/dev/null 2>/dev/null ; then
|
if [ "${SSID}" != "any" ] && type preassociate >/dev/null 2>&1; then
|
||||||
veinfo "Running preassociate function"
|
veinfo "Running preassociate function"
|
||||||
veindent
|
veindent
|
||||||
( preassociate )
|
( preassociate )
|
||||||
@@ -313,7 +313,7 @@ iwconfig_associate() {
|
|||||||
|
|
||||||
iwconfig_report
|
iwconfig_report
|
||||||
|
|
||||||
if type postassociate >/dev/null 2>/dev/null ; then
|
if type postassociate >/dev/null 2>&1; then
|
||||||
veinfo "Running postassociate function"
|
veinfo "Running postassociate function"
|
||||||
veindent
|
veindent
|
||||||
( postassociate )
|
( postassociate )
|
||||||
@@ -377,7 +377,7 @@ iwconfig_scan() {
|
|||||||
case "${line}" in
|
case "${line}" in
|
||||||
*Address:*)
|
*Address:*)
|
||||||
APS=$((${APS} + 1))
|
APS=$((${APS} + 1))
|
||||||
eval MAC_${APS}=\""$(echo "${line#*: }" | tr '[:lower:]' '[:upper:]')"\"
|
eval MAC_${APS}="\""$(echo "${line#*: }" | tr '[:lower:]' '[:upper:]')"\""
|
||||||
eva l QUALITY_${APS}=0
|
eva l QUALITY_${APS}=0
|
||||||
;;
|
;;
|
||||||
*ESSID:*)
|
*ESSID:*)
|
||||||
@@ -388,7 +388,7 @@ iwconfig_scan() {
|
|||||||
*Mode:*)
|
*Mode:*)
|
||||||
x="$(echo "${line#*:}" | tr '[:upper:]' '[:lower:]')"
|
x="$(echo "${line#*:}" | tr '[:upper:]' '[:lower:]')"
|
||||||
if [ "${x}" = "master" ]; then
|
if [ "${x}" = "master" ]; then
|
||||||
eval MODE_${APS}=\"managed\"
|
eval MODE_${APS}=managed
|
||||||
else
|
else
|
||||||
eval MODE_${APS}=\$x
|
eval MODE_${APS}=\$x
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -45,14 +45,14 @@ netplugd_pre_start() {
|
|||||||
|
|
||||||
# We need a valid MAC address
|
# We need a valid MAC address
|
||||||
# It's a basic test to ensure it's not a virtual interface
|
# It's a basic test to ensure it's not a virtual interface
|
||||||
if ! _get_mac_address >/dev/null 2>/dev/null ; then
|
if ! _get_mac_address >/dev/null 2>&1; then
|
||||||
vewarn "netplug only works on interfaces with a valid MAC address"
|
vewarn "netplug only works on interfaces with a valid MAC address"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We don't work on bonded, bridges, tun/tap, vlan or wireless
|
# We don't work on bonded, bridges, tun/tap, vlan or wireless
|
||||||
for f in bond bridge tuntap vlan wireless; do
|
for f in bond bridge tuntap vlan wireless; do
|
||||||
if type "_is_${f}" >/dev/null 2>/dev/null ; then
|
if type "_is_${f}" >/dev/null 2>&1; then
|
||||||
if _is_${f}; then
|
if _is_${f}; then
|
||||||
veinfo "netplug does not work with" "${f}"
|
veinfo "netplug does not work with" "${f}"
|
||||||
return 0
|
return 0
|
||||||
@@ -76,13 +76,13 @@ netplugd_pre_start() {
|
|||||||
eval timeout=\$plug_timeout_${IFVAR}
|
eval timeout=\$plug_timeout_${IFVAR}
|
||||||
[ -z "${timeout}" ] && timeout=-1
|
[ -z "${timeout}" ] && timeout=-1
|
||||||
if [ ${timeout} -eq 0 ]; then
|
if [ ${timeout} -eq 0 ]; then
|
||||||
ewarn "WARNING: infinite timeout set for" "${IFACE}" "to come up"
|
ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
|
||||||
elif [ ${timeout} -lt 0 ]; then
|
elif [ ${timeout} -lt 0 ]; then
|
||||||
einfo "Backgrounding ..."
|
einfo "Backgrounding ..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
veinfo "Waiting for" "${IFACE}" "to be marked as started"
|
veinfo "Waiting for ${IFACE} to be marked as started"
|
||||||
|
|
||||||
local i=0
|
local i=0
|
||||||
while true; do
|
while true; do
|
||||||
@@ -91,12 +91,12 @@ netplugd_pre_start() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
[ ${timeout} -eq 0 ]] && continue
|
[ ${timeout} -eq 0 ] && continue
|
||||||
i=$((${i} + 1))
|
i=$((${i} + 1))
|
||||||
[ ${i} -ge ${timeout} ] && break
|
[ ${i} -ge ${timeout} ] && break
|
||||||
done
|
done
|
||||||
|
|
||||||
eend 1 "Failed to configure" "${IFACE}" "in the background"
|
eend 1 "Failed to configure ${IFACE} in the background"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ pump_stop() {
|
|||||||
start-stop-daemon --quiet --test --stop --exec /sbin/pump || return 0
|
start-stop-daemon --quiet --test --stop --exec /sbin/pump || return 0
|
||||||
|
|
||||||
# Check that pump is running on the interface
|
# Check that pump is running on the interface
|
||||||
if ! pump --status --interface "${IFACE}" >/dev/null 2>/dev/null ; then
|
if ! pump --status --interface "${IFACE}" >/dev/null 2>&1; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ wpa_supplicant_depend() {
|
|||||||
|
|
||||||
# Only set these functions if not set already
|
# Only set these functions if not set already
|
||||||
# IE, prefer to use iwconfig
|
# IE, prefer to use iwconfig
|
||||||
if ! type _get_ssid >/dev/null 2>/dev/null ; then
|
if ! type _get_ssid >/dev/null 2>&1; then
|
||||||
_get_ssid() {
|
_get_ssid() {
|
||||||
local timeout=5 ssid=
|
local timeout=5 ssid=
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ wpa_supplicant_pre_start() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
save_options "SSID" ""
|
save_options "SSID" ""
|
||||||
ebegin "Starting wpa_supplicant on" "${IFVAR}"
|
ebegin "Starting wpa_supplicant on ${IFVAR}"
|
||||||
|
|
||||||
if [ -x /sbin/iwconfig ]; then
|
if [ -x /sbin/iwconfig ]; then
|
||||||
local x=
|
local x=
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ for x in "devpts /dev/pts 0755 ,gid=5,mode=0620" "tmpfs /dev/shm 1777 ,nodev"; d
|
|||||||
|
|
||||||
if [ ! -d "$2" ] && \
|
if [ ! -d "$2" ] && \
|
||||||
[ "${m}" = "devfs" -o "${m}" = "udev" ]; then
|
[ "${m}" = "devfs" -o "${m}" = "udev" ]; then
|
||||||
mkdir -m "$3" -p "$2" >/dev/null 2>/dev/null || \
|
mkdir -m "$3" -p "$2" >/dev/null 2>&1 || \
|
||||||
ewarn "Could not create $2!"
|
ewarn "Could not create $2!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -138,13 +138,15 @@ KV_to_int() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_sanitize_path() {
|
_sanitize_path() {
|
||||||
local IFS=":" p=
|
local IFS=":" p= path=
|
||||||
for p in ${PATH}; do
|
for p in ${PATH}; do
|
||||||
case "${p}" in
|
case "${p}" in
|
||||||
/lib/rc/sbin|/bin|/sbin|/usr/bin|/usr/sbin|/usr/local/bin|/usr/local/sbin);;
|
/lib/rc/sbin|/bin|/sbin|/usr/bin|/usr/sbin|/usr/local/bin|/usr/local/sbin);;
|
||||||
*) printf "%s" ":${p}";;
|
*) path="${path}:${p}";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "${path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow our scripts to support zsh
|
# Allow our scripts to support zsh
|
||||||
|
|||||||
38
sh/net.sh
38
sh/net.sh
@@ -36,16 +36,18 @@ description="Configures network interfaces."
|
|||||||
__IFS="
|
__IFS="
|
||||||
"
|
"
|
||||||
_shell_var() {
|
_shell_var() {
|
||||||
local rem=$1 c= r=
|
local rem=$1 c= r= var=
|
||||||
while [ -n "${rem}" ]; do
|
while [ -n "${rem}" ]; do
|
||||||
r=${rem#?}
|
r=${rem#?}
|
||||||
c=${rem%${r}}
|
c=${rem%${r}}
|
||||||
case "${c}" in
|
case "${c}" in
|
||||||
[a-zA-Z0-9]) printf "%c" "${c}";;
|
[a-zA-Z0-9]);;
|
||||||
*) printf "_";;
|
*) c=_;;
|
||||||
esac
|
esac
|
||||||
|
var=${var}${c}
|
||||||
rem=${r}
|
rem=${r}
|
||||||
done
|
done
|
||||||
|
echo ${var}
|
||||||
}
|
}
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
@@ -351,7 +353,7 @@ _load_modules() {
|
|||||||
# Wrap our provides
|
# Wrap our provides
|
||||||
local f=
|
local f=
|
||||||
for f in pre_start start post_start; do
|
for f in pre_start start post_start; do
|
||||||
eval "${provides}_${f}() { type ${mod}_${f} >/dev/null 2>/dev/null || return 0; ${mod}_${f} \"\$@\"; }"
|
eval "${provides}_${f}() { type ${mod}_${f} >/dev/null 2>&1 || return 0; ${mod}_${f} \"\$@\"; }"
|
||||||
done
|
done
|
||||||
|
|
||||||
eval module_${mod}_provides="${provides}"
|
eval module_${mod}_provides="${provides}"
|
||||||
@@ -365,7 +367,7 @@ _load_modules() {
|
|||||||
eval x=\$module_${mod}_provides
|
eval x=\$module_${mod}_provides
|
||||||
[ -z "${x}" ] && continue
|
[ -z "${x}" ] && continue
|
||||||
for f in pre_start start post_start; do
|
for f in pre_start start post_start; do
|
||||||
eval "${x}_${f}() { type ${mod}_${f} >/dev/null 2>/dev/null || return 0; ${mod}_${f} \"\$@\"; }"
|
eval "${x}_${f}() { type ${mod}_${f} >/dev/null 2>&1 || return 0; ${mod}_${f} \"\$@\"; }"
|
||||||
done
|
done
|
||||||
eval module_${x}_providedby="${mod}"
|
eval module_${x}_providedby="${mod}"
|
||||||
;;
|
;;
|
||||||
@@ -446,7 +448,7 @@ start() {
|
|||||||
# We up the iface twice if we have a preup to ensure it's up if
|
# We up the iface twice if we have a preup to ensure it's up if
|
||||||
# available in preup and afterwards incase the user inadvertently
|
# available in preup and afterwards incase the user inadvertently
|
||||||
# brings it down
|
# brings it down
|
||||||
if type preup >/dev/null 2>/dev/null ; then
|
if type preup >/dev/null 2>&1; then
|
||||||
_up 2>/dev/null
|
_up 2>/dev/null
|
||||||
ebegin "Running preup"
|
ebegin "Running preup"
|
||||||
eindent
|
eindent
|
||||||
@@ -457,7 +459,7 @@ start() {
|
|||||||
_up 2>/dev/null
|
_up 2>/dev/null
|
||||||
|
|
||||||
for module in ${MODULES}; do
|
for module in ${MODULES}; do
|
||||||
if type "${module}_pre_start" >/dev/null 2>/dev/null ; then
|
if type "${module}_pre_start" >/dev/null 2>&1; then
|
||||||
if ! ${module}_pre_start; then
|
if ! ${module}_pre_start; then
|
||||||
eend 1
|
eend 1
|
||||||
exit 1
|
exit 1
|
||||||
@@ -508,7 +510,7 @@ start() {
|
|||||||
null) :;;
|
null) :;;
|
||||||
[0-9]*|*:*) _add_address ${config};;
|
[0-9]*|*:*) _add_address ${config};;
|
||||||
*)
|
*)
|
||||||
if type "${config}_start" >/dev/null 2>/dev/null ; then
|
if type "${config}_start" >/dev/null 2>&1; then
|
||||||
"${config}"_start
|
"${config}"_start
|
||||||
else
|
else
|
||||||
eerror "nothing provides \`${config}'"
|
eerror "nothing provides \`${config}'"
|
||||||
@@ -533,7 +535,7 @@ start() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if ! ${oneworked}; then
|
if ! ${oneworked}; then
|
||||||
if type failup >/dev/null 2>/dev/null ; then
|
if type failup >/dev/null 2>&1; then
|
||||||
ebegin "Running failup"
|
ebegin "Running failup"
|
||||||
eindent
|
eindent
|
||||||
failup
|
failup
|
||||||
@@ -569,7 +571,7 @@ ${routes}"
|
|||||||
*) cmd="-host ${cmd}";;
|
*) cmd="-host ${cmd}";;
|
||||||
esac
|
esac
|
||||||
if ${hidefirstroute}; then
|
if ${hidefirstroute}; then
|
||||||
_add_route ${cmd} >/dev/null 2>/dev/null
|
_add_route ${cmd} >/dev/null 2>&1
|
||||||
hidefirstroute=false
|
hidefirstroute=false
|
||||||
else
|
else
|
||||||
_add_route ${cmd} >/dev/null
|
_add_route ${cmd} >/dev/null
|
||||||
@@ -580,7 +582,7 @@ ${routes}"
|
|||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
for module in ${MODULES}; do
|
for module in ${MODULES}; do
|
||||||
if type "${module}_post_start" >/dev/null 2>/dev/null ; then
|
if type "${module}_post_start" >/dev/null 2>&1; then
|
||||||
if ! ${module}_post_start; then
|
if ! ${module}_post_start; then
|
||||||
eend 1
|
eend 1
|
||||||
exit 1
|
exit 1
|
||||||
@@ -588,7 +590,7 @@ ${routes}"
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if type postup >/dev/null 2>/dev/null ; then
|
if type postup >/dev/null 2>&1; then
|
||||||
ebegin "Running postup"
|
ebegin "Running postup"
|
||||||
eindent
|
eindent
|
||||||
postup
|
postup
|
||||||
@@ -610,7 +612,7 @@ stop() {
|
|||||||
_load_modules false
|
_load_modules false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if type predown >/dev/null 2>/dev/null ; then
|
if type predown >/dev/null 2>&1; then
|
||||||
ebegin "Running predown"
|
ebegin "Running predown"
|
||||||
eindent
|
eindent
|
||||||
predown || return 1
|
predown || return 1
|
||||||
@@ -623,7 +625,7 @@ stop() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for module in ${MODULES}; do
|
for module in ${MODULES}; do
|
||||||
if type "${module}_pre_stop" >/dev/null 2>/dev/null ; then
|
if type "${module}_pre_stop" >/dev/null 2>&1; then
|
||||||
if ! ${module}_pre_stop; then
|
if ! ${module}_pre_stop; then
|
||||||
eend 1
|
eend 1
|
||||||
exit 1
|
exit 1
|
||||||
@@ -632,18 +634,18 @@ stop() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
for module in ${MODULES}; do
|
for module in ${MODULES}; do
|
||||||
if type "${module}_stop" >/dev/null 2>/dev/null ; then
|
if type "${module}_stop" >/dev/null 2>&1; then
|
||||||
${module}_stop
|
${module}_stop
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Only delete addresses for non PPP interfaces
|
# Only delete addresses for non PPP interfaces
|
||||||
if ! type is_ppp >/dev/null 2>/dev/null || ! is_ppp ; then
|
if ! type is_ppp >/dev/null 2>&1 || ! is_ppp; then
|
||||||
_delete_addresses "${IFACE}"
|
_delete_addresses "${IFACE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for module in ${MODULES}; do
|
for module in ${MODULES}; do
|
||||||
if type "${module}_post_stop" >/dev/null 2>/dev/null ; then
|
if type "${module}_post_stop" >/dev/null 2>&1; then
|
||||||
${module}_post_stop
|
${module}_post_stop
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -654,7 +656,7 @@ stop() {
|
|||||||
|
|
||||||
type resolvconf >/dev/null 2>&1 && resolvconf -d "${IFACE}"
|
type resolvconf >/dev/null 2>&1 && resolvconf -d "${IFACE}"
|
||||||
|
|
||||||
if type postdown >/dev/null 2>/dev/null ; then
|
if type postdown >/dev/null 2>&1; then
|
||||||
ebegin "Running postdown"
|
ebegin "Running postdown"
|
||||||
eindent
|
eindent
|
||||||
postdown
|
postdown
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ is_net_fs() {
|
|||||||
|
|
||||||
is_union_fs() {
|
is_union_fs() {
|
||||||
[ ! -x /sbin/unionctl ] && return 1
|
[ ! -x /sbin/unionctl ] && return 1
|
||||||
unionctl "$1" --list >/dev/null 2>/dev/null
|
unionctl "$1" --list >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
get_bootparam() {
|
get_bootparam() {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ do_unmount() {
|
|||||||
local sig="KILL"
|
local sig="KILL"
|
||||||
[ ${retry} -gt 0 ] && sig="TERM"
|
[ ${retry} -gt 0 ] && sig="TERM"
|
||||||
fuser ${f_kill}${sig} -k ${f_opts} "${mnt}" \
|
fuser ${f_kill}${sig} -k ${f_opts} "${mnt}" \
|
||||||
>/dev/null 2>/dev/null
|
>/dev/null 2>&1
|
||||||
sleep 1
|
sleep 1
|
||||||
retry=$((${retry} - 1))
|
retry=$((${retry} - 1))
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user