diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-06-25 00:04:00 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-06-25 00:04:00 +0200 |
commit | 12d1e774cee5058c6fe9ec8505772afb7091ed3a (patch) | |
tree | 50d8619aedd1b2a5eb5ed4f1c0a7effc6311c885 | |
parent | 3fcb56d6743fc1c00ae4d05b671e221ea3df6492 (diff) | |
download | netctl-12d1e774cee5058c6fe9ec8505772afb7091ed3a.tar.gz netctl-12d1e774cee5058c6fe9ec8505772afb7091ed3a.tar.xz |
Make AUTO_PROFILES an array
The previous commit alters the config file (/etc/conf.d/netcfg), marking the right moment for this change.
-rw-r--r-- | config/netcfg | 10 | ||||
-rwxr-xr-x | 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 |