From 91f5c08bb60985769c0d74ed1f556284df0b91fd Mon Sep 17 00:00:00 2001 From: James Rayner Date: Mon, 17 Aug 2009 18:19:44 +1000 Subject: prevent check_iface from always returning external, output from get_iface_prof --- src/network | 8 ++++---- 1 file 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 } -- cgit v1.2.3-24-g4f1b