From 93c8827205680c2e7b5d1ad70ce969622789ed25 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 3 Dec 2020 04:56:47 -0700 Subject: [PATCH] wifi executor: fix up some shell nitpicks --- executor-scripts/linux/wifi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/executor-scripts/linux/wifi b/executor-scripts/linux/wifi index 19a3102..1f239f5 100755 --- a/executor-scripts/linux/wifi +++ b/executor-scripts/linux/wifi @@ -60,7 +60,8 @@ use_supplicant() { return 1 } -# Start a supplicant process for $IFACE. +# Either start a supplicant process for $IFACE, or use iwconfig to trigger an +# association attempt. start() { if use_supplicant; then # If there is no config file located at $WIFI_CONFIG_PATH, generate one. @@ -72,12 +73,13 @@ start() { fi } -# Stop the supplicant process for $IFACE. +# Either stop the supplicant process for $IFACE, or use iwconfig to dissociate +# from the current SSID. stop() { if use_supplicant; then kill -9 $(cat $PIDFILE) 2>/dev/null - [ -z "$IF_WIFI_CONFIG_PATH" ] && rm $WIFI_CONFIG_PATH - rm $PIDFILE + [ -z "$IF_WIFI_CONFIG_PATH" ] && rm -- "$WIFI_CONFIG_PATH" + rm -- "$PIDFILE" else /usr/sbin/iwconfig $IFACE essid any fi