summaryrefslogtreecommitdiff
path: root/scripts/athenable
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/athenable')
-rwxr-xr-xscripts/athenable42
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/athenable b/scripts/athenable
new file mode 100755
index 00000000..176e320f
--- /dev/null
+++ b/scripts/athenable
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
+#
+# Makes sure either ath5k or MadWifi are ready to be used. This allows
+# us to choose any driver without blacklisting each other.
+
+. /usr/lib/compat-wireless/modlib.sh
+
+if [[ $UID -ne 0 ]]; then
+ echo "Run with root privileges"
+ exit
+fi
+
+ATH5K="ath5k"
+MADWIFI="ath_pci"
+# Appended to module file at the end when we want to ignore one
+IGNORE_SUFFIX=".ignore"
+USAGE="Usage: $0 [ ath5k | madwifi ]"
+
+# Default behavior: disables any MadWifi driver present and makes sure
+# ath5k is enabled
+if [ $# -eq 0 ]; then
+ module_disable $MADWIFI
+ module_enable $ATH5K
+ exit
+elif [ $# -ne 1 ]; then
+ echo "$USAGE"
+ exit
+fi
+
+MODULE=$1
+if [ "$MODULE" == "ath5k" ]; then
+ module_disable $MADWIFI
+ module_enable $ATH5K
+elif [ "$MODULE" == "madwifi" ]; then
+ module_disable $ATH5K
+ module_enable $MADWIFI
+else
+ echo "$USAGE"
+ exit
+fi