From c5917b856db1e32a863fa78b54d5a7533c99577a Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Tue, 21 Mar 2017 17:21:53 +0100 Subject: 9.70-sync: sysconfig/network-scripts/* updated - part 2 This commit contains a lot of whitespace changes. Use 'git diff --ignore-all-space' to display the relevant changes. --- sysconfig/network-scripts/ifup-wireless | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'sysconfig/network-scripts/ifup-wireless') diff --git a/sysconfig/network-scripts/ifup-wireless b/sysconfig/network-scripts/ifup-wireless index 70e84a21..702b6199 100755 --- a/sysconfig/network-scripts/ifup-wireless +++ b/sysconfig/network-scripts/ifup-wireless @@ -26,31 +26,37 @@ # Only meant to be called from ifup. -IW=iw +cd /etc/sysconfig/network-scripts +. ./network-functions + +IW=${IW:-iw} -[ "$DEVICE" -a "$MODE" ] || exit [ "$KEY" ] && KEYS="key d:0:$KEY" shopt -s nocasematch case "$MODE" in managed) - [ "$ESSID" ] || exit - $IW dev "$DEVICE" set type managed - $IW dev "$DEVICE" connect -w "$ESSID" $FREQ $KEYS + if [ "$ESSID" ]; then + $IW dev "$DEVICE" set type managed + $IW dev "$DEVICE" connect -w "$ESSID" $FREQ $KEYS + fi ;; ad-hoc) - [ "$ESSID" && "$FREQ" ] || exit - $IW dev "$DEVICE" set type ibss - $IW dev "$DEVICE" ibss join "$ESSID" "$FREQ" $KEYS + if [ -n "$ESSID" -a -n "$FREQ" ]; then + $IW dev "$DEVICE" set type ibss + $IW dev "$DEVICE" ibss join "$ESSID" "$FREQ" $KEYS + fi ;; monitor) - [ "$FREQ" ] || exit - $IW dev "$DEVICE" set type monitor - $IW dev "$DEVICE" set freq "$FREQ" + if [ "$FREQ" ]; then + $IW dev "$DEVICE" set type monitor + $IW dev "$DEVICE" set freq "$FREQ" + fi + ;; esac if [ -n "$WOWLAN" ] ; then - PHYDEVICE=phy_wireless_device $DEVICE + PHYDEVICE=$(phy_wireless_device $DEVICE) iw phy $PHYDEVICE wowlan enable ${WOWLAN} fi -- cgit v1.2.1