summaryrefslogtreecommitdiffstats
path: root/rc.d/net-auto-wireless
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 /rc.d/net-auto-wireless
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 'rc.d/net-auto-wireless')
-rwxr-xr-xrc.d/net-auto-wireless8
1 files changed, 3 insertions, 5 deletions
diff --git a/rc.d/net-auto-wireless b/rc.d/net-auto-wireless
index a03097b..79c43b0 100755
--- a/rc.d/net-auto-wireless
+++ b/rc.d/net-auto-wireless
@@ -10,7 +10,7 @@ if [[ ! -x /usr/sbin/wpa_actiond ]]; then
exit 1
fi
-if [ -z "${WIRELESS_INTERFACE}" ]; then
+if [[ -z "${WIRELESS_INTERFACE}" ]]; then
echo "No interface name set. Add to /etc/conf.d/netcfg a line"
echo " WIRELESS_INTERFACE=\"your_interface\""
exit 1
@@ -31,8 +31,7 @@ case "$1" in
done
stat_busy "Starting netcfg auto-wireless mode for interface ${WIRELESS_INTERFACE}"
- /usr/bin/netcfg-wpa_actiond "${WIRELESS_INTERFACE}" >/dev/null
- if [ $? -eq 0 ]; then
+ if /usr/bin/netcfg-wpa_actiond "${WIRELESS_INTERFACE}" >/dev/null; then
add_daemon net-auto-wireless
stat_done
else
@@ -42,8 +41,7 @@ case "$1" in
stop)
if ! ck_daemon net-auto-wireless; then
stat_busy "Stopping netcfg auto-wireless mode for interface ${WIRELESS_INTERFACE}"
- /usr/bin/netcfg-wpa_actiond stop "${WIRELESS_INTERFACE}" >/dev/null
- if [ $? -eq 0 ]; then
+ if /usr/bin/netcfg-wpa_actiond stop "${WIRELESS_INTERFACE}" >/dev/null; then
rm_daemon net-auto-wireless
stat_done
else