summaryrefslogtreecommitdiffstats
path: root/src/wireless
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-09-14 05:43:36 +0200
committerJames Rayner <james@archlinux.org>2009-09-14 08:23:03 +0200
commit5a2279c70d1c6db3afab45f4ff6df420daa514e9 (patch)
tree734714abd9a366e87f38a810a5bee7dbe1c55e37 /src/wireless
parent55a840edd32ac45b35c4d7c604bcfe00e0ee7fbc (diff)
downloadnetctl-5a2279c70d1c6db3afab45f4ff6df420daa514e9.tar.gz
netctl-5a2279c70d1c6db3afab45f4ff6df420daa514e9.tar.xz
check for $IFACE_DIR/$INTERFACE before sourcing
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src/wireless')
-rw-r--r--src/wireless4
1 files changed, 2 insertions, 2 deletions
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")