From 12d1e774cee5058c6fe9ec8505772afb7091ed3a Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Mon, 25 Jun 2012 00:04:00 +0200 Subject: Make AUTO_PROFILES an array The previous commit alters the config file (/etc/conf.d/netcfg), marking the right moment for this change. --- config/netcfg | 10 +++++----- scripts/netcfg-wpa_actiond | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/config/netcfg b/config/netcfg index e74e5ea..59ee57c 100644 --- a/config/netcfg +++ b/config/netcfg @@ -5,12 +5,12 @@ # Network profiles are found in /etc/network.d NETWORKS=(last) -## Specify the name of your wired interface for net-auto-wired +# Specify the name of your wired interface for net-auto-wired WIRED_INTERFACE="eth0" -## Specify the name of your wireless interface for net-auto-wireless +# Specify the name of your wireless interface for net-auto-wireless WIRELESS_INTERFACE="wlan0" -## List of profiles that can be started by net-auto-wireless -## defaults to the list of all wireless profiles -#AUTO_PROFILES="profile1 profile2" +# Array of profiles that may be started by net-auto-wireless. +# When not specified, all wireless profiles are considered. +#AUTO_PROFILES=("profile1" "profile2") diff --git a/scripts/netcfg-wpa_actiond b/scripts/netcfg-wpa_actiond index 72f3231..744b7af 100755 --- a/scripts/netcfg-wpa_actiond +++ b/scripts/netcfg-wpa_actiond @@ -52,7 +52,13 @@ fi WPA_CONF="$(make_wpa_config_file $interface)" if [[ -n "${AUTO_PROFILES}" ]]; then - for prof in ${AUTO_PROFILES}; do echo $prof; done + # At some point, this can be removed. + if [[ ${#AUTO_PROFILES[@]} -eq 1 ]]; then + report_err "Please convert AUTO_PROFILES to an array in /etc/conf.d/netcfg." + AUTO_PROFILES=($AUTO_PROFILES) + fi + + for prof in "${AUTO_PROFILES[@]}"; do echo "$prof"; done else list_profiles fi | while read profile; do -- cgit v1.2.3-24-g4f1b