summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-07-14 06:57:59 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-07-14 06:57:59 +0200
commita02fed0ee3f23bb468f1577a61f24ff289bf3a6b (patch)
tree0c487797e6065245353fc7b5cb43b1d4b1476f39 /scripts
parentb3ed84cf5a9166b0591488a2758c2bb1f19dc137 (diff)
downloadnetctl-a02fed0ee3f23bb468f1577a61f24ff289bf3a6b.tar.gz
netctl-a02fed0ee3f23bb468f1577a61f24ff289bf3a6b.tar.xz
Fix pid-based kills (FS#30664)
The command argument to timeout_wait cannot reference positional parameters (they would become the positional parameters to timeout_wait). We kill wpa_actiond if it does not die with wpa_supplicant.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/netcfg-wpa_actiond3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/netcfg-wpa_actiond b/scripts/netcfg-wpa_actiond
index 345b9b0..7adde5c 100755
--- a/scripts/netcfg-wpa_actiond
+++ b/scripts/netcfg-wpa_actiond
@@ -16,8 +16,11 @@ case $1 in
stop)
[[ -z $2 ]] && echo "Please specify an interface to stop" && exit 1
interface=$2
+ PIDFILE="/run/wpa_actiond_${interface}.pid"
[[ -f "$IFACE_DIR/$interface" ]] && source "$IFACE_DIR/$interface"
netcfg -D "$interface"
+ timeout_wait 1 '[[ ! -f "$PIDFILE" ]]' || \
+ kill "$(< "$PIDFILE")"
# only try to disable software rfkill switches (FS#25514)
if [[ "$RFKILL" == "soft" ]]; then
set_rf_state "$interface" disabled $RFKILL_NAME || exit $?