4 # Provides: wpa-ifupdown
5 # Required-Start: $network
6 # Required-Stop: $network $remote_fs
11 # Short-Description: Stop wpa_supplicant processes started via ifupdown
12 # Description: Run ifdown on interfaces authenticated via
13 # wpa_supplicant. Sendsigs terminates wpa_supplicant
14 # processes before networking is stopped causing each
15 # network interface authenticated via a wpa_supplicant
16 # daemon to be terminated abrubtly.
17 # Since initscripts package version 2.86.ds1-48 an
18 # interface exists to omit process id's from sendsigs. If
19 # this interface is present this script is a no-op.
22 PATH=/usr/sbin:/usr/bin:/sbin:/bin
24 test -d /var/run || exit 0
26 test -x /sbin/ifdown || exit 0
28 . /lib/lsb/init-functions
31 test -x /sbin/wpa_action || return 0
32 IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_action.*.pid' -printf '%P\n' | \
33 cut -d'.' -f2 2>/dev/null)
34 if test -n "$IFACES"; then
35 log_daemon_msg "Stopping wpa_action roaming interfaces"
36 for iface in $IFACES; do
37 log_progress_msg "$iface"
38 # wpa_action executes /sbin/ifdown
39 wpa_action "$iface" stop >/dev/null 2>&1
45 stop_wpa_supplicant () {
46 IFACES=$(find /var/run -maxdepth 1 -type f -name 'wpa_supplicant.*.pid' -printf '%P\n' | \
47 grep -v wpa_supplicant.dbus.pid | cut -d'.' -f2 2>/dev/null)
48 if test -n "$IFACES"; then
49 log_daemon_msg "Stopping wpa_supplicant interfaces"
50 for iface in $IFACES; do
51 log_progress_msg "$iface"
52 ifdown "$iface" >/dev/null 2>&1
58 sendsigs_omission_support () {
59 if [ -d /lib/init/rw/sendsigs.omit.d/ ]; then
62 elif [ -d /var/run/sendsigs.omit.d/ ]; then
63 # Ubuntu, cf. https://bugs.launchpad.net/bugs/181541
71 start|restart|force-reload)
75 if sendsigs_omission_support; then
83 echo "Usage: $0 {start|stop|restart|force-reload}" >&2