summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-08-17 10:19:44 +0200
committerJames Rayner <james@archlinux.org>2009-08-17 10:19:44 +0200
commit91f5c08bb60985769c0d74ed1f556284df0b91fd (patch)
treec49d5a284b5846d313878009f1d23cc0d340c303 /src
parent09a2212f344e5bdf7573584a9b8ef5b64c7b1fac (diff)
downloadnetctl-91f5c08bb60985769c0d74ed1f556284df0b91fd.tar.gz
netctl-91f5c08bb60985769c0d74ed1f556284df0b91fd.tar.xz
prevent check_iface from always returning external, output from get_iface_prof
Diffstat (limited to 'src')
-rw-r--r--src/network8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network b/src/network
index 8b1c088..7009893 100644
--- a/src/network
+++ b/src/network
@@ -257,12 +257,12 @@ interface_down()
check_iface() {
if [[ -f "$STATE_DIR/interfaces/$1" ]]; then (
. "$STATE_DIR/interfaces/$1"
- if [[ "$PROFILE" -eq external ]]; then
+ if [[ "$PROFILE" == "external" ]]; then
echo "external"
else
echo "up"
fi
- return 0
+ exit 0
)
else
return 1
@@ -274,7 +274,7 @@ check_iface() {
# Return 1 if down.
#
get_iface_prof() {
- if check_iface "$1"; then
+ if check_iface "$1" &>/dev/null; then
. "$STATE_DIR/interfaces/$1"
echo "$PROFILE"
else
@@ -293,7 +293,7 @@ list_profiles() {
# Return 1 if profile not registered
#
check_profile() {
- [[ -f "$STATE_DIR/profiles/$1" && ! -f "$STATE_DIR/suspend/$1" ]] && return 0
+ [[ -f "$STATE_DIR/profiles/$1" ]] && return 0
return 1
}