/lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant is in dhcpcd5 6.0.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # Start, reconfigure and stop wpa_supplicant per wireless interface.
# This is needed because wpa_supplicant lacks hotplugging of any kind
# and the user should not be expected to have to wire it into their system
# if the base system doesn't do this itself.
: ${wpa_supplicant_conf:=/etc/wpa_supplicant.conf}
wpa_supplicant_start()
{
local err errn
wpa_cli -i "$interface" status >/dev/null 2>&1 && return 0
syslog info "starting wpa_supplicant"
err=$(wpa_supplicant -B -c"$wpa_supplicant_conf" -i"$interface" 2>&1)
errn=$?
if [ $errn != 0 ]; then
syslog err "failed to start wpa_supplicant"
syslog err "$err"
fi
return $errn
}
wpa_supplicant_reconfigure()
{
local err errn
if ! wpa_cli -i "$interface" status >/dev/null 2>&1; then
wpa_supplicant_start
return $?
fi
syslog info "reconfiguring wpa_supplicant"
err=$(wpa_cli -i"$interface" reconfigure 2>&1)
errn=$?
if [ $errn != 0 ]; then
syslog err "failed to reconfigure wpa_supplicant"
syslog err "$err"
fi
return $errn
}
wpa_supplicant_stop()
{
local err errn
wpa_cli -i "$interface" status >/dev/null 2>&1 || return 0
syslog info "stopping wpa_supplicant"
err=$(wpa_cli -i"$interface" terminate 2>&1)
errn=$?
if [ $errn != 0 ]; then
syslog err "failed to start wpa_supplicant"
syslog err "$err"
fi
return $errn
}
if [ "$ifwireless" = "1" -a -s "$wpa_supplicant_conf" ] && \
type wpa_supplicant >/dev/null 2>&1 && \
type wpa_cli >/dev/null 2>&1
then
case "$reason" in
PREINIT) wpa_supplicant_start;;
RECONFIGURE) wpa_supplicant_reconfigure;;
DEPARTED) wpa_supplicant_stop;;
esac
fi
|