When using the net-auto-wireless profile, it can be very helpful to
prefer certain connections over others.
Signed-off-by: Dan McGee
---
docs/wireless | 4 +++-
src/8021x | 5 ++++-
src/network | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/docs/wireless b/docs/wireless
index 2e466c7..8bda63b 100644
--- a/docs/wireless
+++ b/docs/wireless
@@ -18,13 +18,15 @@ ESSID (this or AP is required)
AP (this or ESSID is required)
: AP (BSSID) of the network to connect to.
HIDDEN (optional)
-: Define this to connect to hidden ESSIDs.
+: Assume the SSID of this network might not be broadcast and probe for it instead. Can be 'yes' or 'no', defaults to 'no'.
ADHOC (optional)
: Define this to use ad-hoc mode for wireless.
TIMEOUT (optional)
: Time to wait for association. Defaults to 15 seconds.
SCAN (optional)
: yes/no Scan for a wireless network rather than blindly attempting to connect. Hidden SSID networks do not appear in a scan.
+PRIORITY (optional)
+: Integer value to use as the wpa_supplicant priority value for this network. The default is '0'. This will override the default internal preferences of wpa_supplicant.
IWCONFIG (optional, deprecated)
: Run iwconfig with these options before attempting to configure the connection.
diff --git a/src/8021x b/src/8021x
index 267a358..a371ff8 100644
--- a/src/8021x
+++ b/src/8021x
@@ -222,7 +222,10 @@ make_wpa_config() {
if checkyesno ${HIDDEN:-no}; then
echo "scan_ssid=1"
fi
+
+ if (( $PRIORITY > 0 )); then
+ echo "priority=$PRIORITY"
+ fi
}
# vim: ft=sh ts=4 et sw=4 tw=0:
-
diff --git a/src/network b/src/network
index 316183e..953e502 100644
--- a/src/network
+++ b/src/network
@@ -10,7 +10,7 @@ load_profile()
{
unset ADDR AP AUTH8021X CONNECTION DESCRIPTION
unset DHCP_OPTIONS DHCP_TIMEOUT DHCLIENT DNS DNS1 DNS2 DOMAIN
- unset ESSID GATEWAY HIDDEN IFOPTS INTERFACE IP IPCFG
+ unset ESSID GATEWAY HIDDEN IFOPTS INTERFACE IP IPCFG PRIORITY
unset IWCONFIG
unset KEY NETMASK RFKILL RFKILL_NAME SCAN SEARCH TIMEOUT
unset VLAN_ID VLAN_PHYS_DEV
--
1.7.5.2