X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cycle_wireless;h=dc949cca4e8dd06ecf0c9dff23f9cc10b6897f80;hb=1886c7247cb16ed68a78cd5550b152689a465999;hp=90b940e0d64014c17eaddca9638dbc1bd181e453;hpb=cc2fea7819e922ed490559bee9fde0c93907318c;p=bin.git diff --git a/cycle_wireless b/cycle_wireless index 90b940e..dc949cc 100755 --- a/cycle_wireless +++ b/cycle_wireless @@ -1,15 +1,6 @@ #!/bin/sh -NETWORK="$1" -WIRELESS="$2" - -if [ -z "$NETWORK" ]; then - NETWORK="homewlan"; -fi; - -if [ -z "$WIRELESS" ]; then - WIRELESS="wireless"; -fi; +WIRELESS="$1" # First try a minor cycle @@ -25,8 +16,14 @@ fi; # Failure, so major cycle sudo ifdown wireless; -if [ "$WIRELESS" == "wireless" ]; then - sudo modprobe -r bcm43xx; - sudo modprobe bcm43xx; +if [ "$WIRELESS" == "wireless" ]; then + if lsmod|grep -q bcm43xx; then + sudo modprobe -r bcm43xx; + sudo modprobe bcm43xx; + else + sudo modprobe -r b43; + sudo modprobe b43; + fi; + sleep 2s; fi; -sudo ifup "wireless=${NETWORK}"; +sudo ifup "wireless";