aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Šimerda <psimerda@redhat.com>2014-02-19 11:19:42 +0100
committerPavel Šimerda <psimerda@redhat.com>2014-02-19 11:19:42 +0100
commit918a5170e64a9766b443d3a65f9b6bcf65f1e60a (patch)
tree33e9a5fd03130a733d52f247f10a06f7ccbc9a68
parent343858fcb6af8451bba3ef3d780666e01d2ce7ad (diff)
downloadinitscripts-918a5170e64a9766b443d3a65f9b6bcf65f1e60a.tar
initscripts-918a5170e64a9766b443d3a65f9b6bcf65f1e60a.tar.gz
initscripts-918a5170e64a9766b443d3a65f9b6bcf65f1e60a.tar.bz2
initscripts-918a5170e64a9766b443d3a65f9b6bcf65f1e60a.tar.xz
initscripts-918a5170e64a9766b443d3a65f9b6bcf65f1e60a.zip
network: modify ifup-wireless so it doesn't call exit
https://bugzilla.redhat.com/show_bug.cgi?id=1057635
-rwxr-xr-xsysconfig/network-scripts/ifup-wireless25
1 files changed, 14 insertions, 11 deletions
diff --git a/sysconfig/network-scripts/ifup-wireless b/sysconfig/network-scripts/ifup-wireless
index 3b248cca..062b5024 100755
--- a/sysconfig/network-scripts/ifup-wireless
+++ b/sysconfig/network-scripts/ifup-wireless
@@ -26,26 +26,29 @@
# Only meant to be called from ifup.
-IW=iw
+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 [ "$ESSID" && "$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