From 5a2279c70d1c6db3afab45f4ff6df420daa514e9 Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Sun, 13 Sep 2009 23:43:36 -0400 Subject: check for $IFACE_DIR/$INTERFACE before sourcing Signed-off-by: Jim Pryor --- src/wireless | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wireless') diff --git a/src/wireless b/src/wireless index b9ce12a..e1d98ab 100644 --- a/src/wireless +++ b/src/wireless @@ -169,7 +169,7 @@ wpa_supplicant_scan_info() { set_rf_state() { local INTERFACE="$1" state="$2" PROFILE="$3" - source "$IFACE_DIR/$INTERFACE" + [[ -f "$IFACE_DIR/$INTERFACE" ]] && source "$IFACE_DIR/$INTERFACE" [[ -n "$PROFILE" ]] && source "$PROFILE_DIR/$PROFILE" # profile overrides [[ $RFKILL == "hard" ]] && report_fail "Cannot set state on hardware rfkill switch" local path=$(get_rf_path "$INTERFACE" "$RFKILL_NAME") @@ -206,7 +206,7 @@ get_rf_path() { get_rf_state() { local INTERFACE="$1" PROFILE="$2" path state - source "$IFACE_DIR/$INTERFACE" + [[ -f "$IFACE_DIR/$INTERFACE" ]] && source "$IFACE_DIR/$INTERFACE" [[ -n "$PROFILE" ]] && source "$PROFILE_DIR/$PROFILE" # profile overrides path=$(get_rf_path "$INTERFACE" "$RFKILL_NAME") state=$(cat "$path/state") -- cgit v1.2.3-24-g4f1b