diff options
author | Jim Pryor <profjim@jimpryor.net> | 2009-08-11 14:04:52 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-08-15 04:28:26 +0200 |
commit | c0b4b19486aaa6e277c3344c40419225e085bd69 (patch) | |
tree | 22af58137e0ade6080f880340f853cb251f1fd57 /src-wireless | |
parent | e4271e46d3ddfe0a3dbaef66d51157bfd88ca2ff (diff) | |
download | netctl-c0b4b19486aaa6e277c3344c40419225e085bd69.tar.gz netctl-c0b4b19486aaa6e277c3344c40419225e085bd69.tar.xz |
Everyone use i/o functions from globals/hooks
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src-wireless')
-rw-r--r-- | src-wireless/net-auto | 5 | ||||
-rw-r--r-- | src-wireless/netcfg-auto-wireless | 18 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src-wireless/net-auto b/src-wireless/net-auto index 8b724a5..3f74ffc 100644 --- a/src-wireless/net-auto +++ b/src-wireless/net-auto @@ -1,7 +1,6 @@ #!/bin/bash -. /etc/rc.conf -. /etc/rc.d/functions +. /usr/lib/network/globals case "$1" in start) @@ -36,7 +35,7 @@ case "$1" in $0 stop; sleep 1; $0 start ;; *) - echo "usage: $0 {start|stop|restart}" + exit_stderr "Usage: $0 {start|stop|restart}" esac # vim: set ts=4 et sw=4: diff --git a/src-wireless/netcfg-auto-wireless b/src-wireless/netcfg-auto-wireless index e77eb0e..50d49be 100644 --- a/src-wireless/netcfg-auto-wireless +++ b/src-wireless/netcfg-auto-wireless @@ -3,8 +3,6 @@ . /usr/lib/network/network . /usr/lib/network/wireless -. /etc/rc.conf -. /etc/rc.d/functions # wifi_auto # autoconnect wireless interface @@ -12,15 +10,13 @@ wifi_auto() { interface=$1; - stat_busy "Scanning for networks" + report_try "Scanning for networks" ifconfig $interface up networks="$(list_networks $interface)" if [[ ! "$networks" ]]; then - stat_append "- No networks available." - stat_fail - exit 1 + exit_fail "- No networks available." fi # Loop through all the found essid's, then find a matching profile. @@ -42,18 +38,14 @@ wifi_auto() exit $? fi - stat_append "- No profiles matched the found networks" - stat_fail - exit 1 + exit_fail "- No profiles matched the found networks" } if [[ $(id -u) -ne 0 ]]; then - err "This script needs to be run with root priviledges" - exit 1 + exit_stderr "This script needs to be run with root privileges" fi if [[ -z $1 ]]; then - err "Please supply an interface to connect" - exit 1 + exit_stderr "Please supply an interface to connect" fi wifi_auto $1 |