Check "$WPA_CONF_DIR/$INTERFACE" for existence; exit if it's absent (that is, wpa_supplicant isn't running). Just avoids an error message from wpa_cli. Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com> --- src/8021x | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/8021x b/src/8021x index 608d683..d5ea10b 100644 --- a/src/8021x +++ b/src/8021x @@ -73,6 +73,9 @@ stop_wpa() # we need this as long as wpa_cli has a different default than netcfg [[ -z "$WPA_CTRL_DIR" && -z "$WPA_CONF" ]] && WPA_CTRL_DIR="/run/wpa_supplicant" + # exit if wpa_supplicant is already terminated for this interface + [[ -e "$WPA_CTRL_DIR/$INTERFACE" ]] || return + wpa_call "$INTERFACE" terminate > /dev/null # wait up to one second for the pid file to be removed -- 1.7.12.2