summaryrefslogtreecommitdiffstats
path: root/src/8021x
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-03-01 01:33:12 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2012-03-01 01:35:58 +0100
commiteed3f590c9db7cd9cd4d5fb4722fc7257a278ea6 (patch)
treed34406a8af61dccbb9655b899da30d04ce61a623 /src/8021x
parent8d1c5e8ec6b637015e84bbb154ece9065c59f1c5 (diff)
downloadnetctl-eed3f590c9db7cd9cd4d5fb4722fc7257a278ea6.tar.gz
netctl-eed3f590c9db7cd9cd4d5fb4722fc7257a278ea6.tar.xz
Code quality upgrade
This is what you get when Dave Reisner points you at some bash anti-patterns. Also in this commit: - updated documentation - bugfix revision of the IPv6 SLAAC address/route bug
Diffstat (limited to 'src/8021x')
-rw-r--r--src/8021x11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/8021x b/src/8021x
index 13c5b6e..560a44d 100644
--- a/src/8021x
+++ b/src/8021x
@@ -16,7 +16,7 @@ wpa_check()
[[ "$wpa_state" = "$CONDITION" ]]
) && return 0
sleep 1
- let timeout++
+ (( ++timeout ))
done
echo "$wpa_state"
# wpa_cli -i "$INTERFACE" terminate >/dev/null 2>&1 # callers sometimes called stop_wpa, which does more but seems redundant
@@ -178,9 +178,9 @@ make_wpa_config_file() {
# make empty tmp dir with correct permissions, rename it
check_make_state_dir
- # create symlink for old compatibility
+ # create symlink for old compatibility (Jouke: is this still needed?)
mkdir -p /run/wpa_supplicant
- if [ ! -e /var/run/wpa_supplicant ]; then
+ if [[ ! -e /var/run/wpa_supplicant ]]; then
ln -s /run/wpa_supplicant /var/run
fi
rm -rf "$WPA_CONF"
@@ -237,10 +237,11 @@ make_wpa_config() {
echo "key_mgmt=NONE"
;;
wpa)
+ echo "proto=RSN WPA"
if [[ "${#KEY}" -eq 64 ]]; then
- echo "proto=RSN WPA\npsk=$KEY"
+ echo "psk=$KEY"
else
- echo "proto=RSN WPA\npsk=\"$KEY\""
+ echo "psk=\"$KEY\""
fi
;;
esac