aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2020-07-28 10:57:57 +0200
committerOlav Vitters <olav@vitters.nl>2020-07-28 10:57:57 +0200
commit37a78367b03f77b618c65085accadf2643779379 (patch)
tree2e76eff1eca8d1bbffe94773cce2f31180675009
parentfa8a602cfeeb757a2117e4e1ad3d2717e69d34ff (diff)
downloadinitscripts-37a78367b03f77b618c65085accadf2643779379.tar
initscripts-37a78367b03f77b618c65085accadf2643779379.tar.gz
initscripts-37a78367b03f77b618c65085accadf2643779379.tar.bz2
initscripts-37a78367b03f77b618c65085accadf2643779379.tar.xz
initscripts-37a78367b03f77b618c65085accadf2643779379.zip
network-up: fix most shellcheck issues (usually quoting)
-rwxr-xr-xmandriva/network-up22
1 files changed, 11 insertions, 11 deletions
diff --git a/mandriva/network-up b/mandriva/network-up
index d77b2137..7d5360e9 100755
--- a/mandriva/network-up
+++ b/mandriva/network-up
@@ -42,13 +42,13 @@ interfaces=$(/bin/ls ifcfg* | \
function may_have_link() {
local DEVICE=$1
local LINKDELAY=0
- ! check_link_down ${DEVICE} || is_associating ${DEVICE}
+ ! check_link_down "${DEVICE}" || is_associating "${DEVICE}"
}
function is_associating() {
local DEVICE=$1
- is_wireless_device ${DEVICE} || return 1
- local AP=`iwgetid -a -r ${DEVICE} 2>/dev/null`
+ is_wireless_device "${DEVICE}" || return 1
+ local AP=$(iwgetid -a -r "${DEVICE}" 2>/dev/null)
[ -n "$AP" ] && [ "$AP" != "00:00:00:00:00:00" ] && [ "$AP" != "44:44:44:44:44:44" ] && [ "$AP" != "FF:FF:FF:FF:FF:FF" ]
}
@@ -68,7 +68,7 @@ function should_wait_network() {
eval $(LANG=C grep -F "DNS1=" "ifcfg-$i")
eval $(LANG=C grep -F "DNS2=" "ifcfg-$i")
eval $(LANG=C grep -F "NM_CONTROLLED=" "ifcfg-$i")
- [ -z "$REALDEVICE" -a -n "$PARENTDEVICE" ] && REALDEVICE=$PARENTDEVICE
+ [ -z "$REALDEVICE" ] && [ -n "$PARENTDEVICE" ] && REALDEVICE=$PARENTDEVICE
[ -z "$REALDEVICE" ] && REALDEVICE=${DEVICE%%:*}
if [ $LINK_DETECTION_DELAY -lt $MIN_LINK_DETECTION_DELAY ]; then
LINK_DETECTION_DELAY=$MIN_LINK_DETECTION_DELAY
@@ -98,13 +98,13 @@ function should_wait_network() {
fi
# ignore devices that are not present
- ip -o link show ${DEVICE} &>/dev/null || continue
+ ip -o link show "${DEVICE}" &>/dev/null || continue
- ! is_false $NM_CONTROLLED && is_nm_running && _use_nm=true
+ ! is_false "$NM_CONTROLLED" && is_nm_running && _use_nm=true
# for NM controlled just ask NetworkManager
if [ "$_use_nm" = "true" ]; then
# Ignore disabled wifi h/w
- if is_nm_device_unavailable ${DEVICE}; then
+ if is_nm_device_unavailable "${DEVICE}"; then
# Question: Is NM cleverer than us here? Does it do this delay
# internally and mark it as disconnected until it knows better?
@@ -117,7 +117,7 @@ function should_wait_network() {
continue
fi
- is_nm_active ${DEVICE} || return 0
+ is_nm_active "${DEVICE}" || return 0
# The resolvconf check below uses a single generic "NetworkManager"
# DNS file, rather than device specific ones, so fudge the device.
@@ -135,7 +135,7 @@ function should_wait_network() {
fi
# check address is set
- ADDR=`ip addr show scope global ${DEVICE} | awk '/inet/ {print $2;}'`
+ ADDR=$(ip addr show scope global "${DEVICE}" | awk '/inet/ {print $2;}')
if [ -z "$ADDR" ]; then
return 0
fi
@@ -144,7 +144,7 @@ function should_wait_network() {
# wait for changes to be propagated by resolvconf if needed
if [ -e $RESOLVCONF_FLAGFILE ]; then
if [ "$BOOTPROTO" = "dhcp" ] && ! is_false "$PEERDNS" \
- || [ -n "$DNS1" -o -n "$DNS2" ]; then
+ || [ -n "$DNS1" ] || [ -n "$DNS2" ]; then
if [ ! -e $RESOLVCONF_DIR/$DEVICE ]; then
return 0
fi
@@ -181,7 +181,7 @@ case "$1" in
stop)
;;
*)
- gprintf "Usage: %s\n" "$(basename $0) {start|stop}"
+ gprintf "Usage: %s\n" "$(basename "$0") {start|stop}"
exit 1
esac