Send USR1 instead of INT in send_stop()
If create_ap is not attached on a tty, then kill -INT does not work. Use -USR1 instead.
This commit is contained in:
11
create_ap
11
create_ap
@ -428,6 +428,7 @@ ROUTE_ADDRS=
|
|||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
trap "" SIGINT
|
trap "" SIGINT
|
||||||
|
trap "" SIGUSR1
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Doing cleanup..."
|
echo "Doing cleanup..."
|
||||||
@ -539,18 +540,21 @@ is_running_pid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
send_stop() {
|
send_stop() {
|
||||||
|
# send stop signal to specific pid
|
||||||
if is_running_pid $1; then
|
if is_running_pid $1; then
|
||||||
kill -INT $1
|
kill -USR1 $1
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for x in /tmp/create_ap.$1.conf.*; do
|
# send stop signal to specific interface
|
||||||
[[ -f $x/pid ]] && kill -INT $(cat $x/pid)
|
for x in $(list_running | grep -E " ${1}\$" | cut -f1 -d' '); do
|
||||||
|
kill -USR1 $x
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# if the user press ctrl+c then execute die()
|
# if the user press ctrl+c then execute die()
|
||||||
trap "die" SIGINT
|
trap "die" SIGINT
|
||||||
|
trap "die" SIGUSR1
|
||||||
|
|
||||||
ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden","ieee80211n","ht_capab:","driver:","no-virt","fix-unmanaged","country:","freq-band:","mac:","stop:","list" -n $(basename $0) -- "$@")
|
ARGS=$(getopt -o hc:w:g:dnm: -l "help","hidden","ieee80211n","ht_capab:","driver:","no-virt","fix-unmanaged","country:","freq-band:","mac:","stop:","list" -n $(basename $0) -- "$@")
|
||||||
[[ $? -ne 0 ]] && exit 1
|
[[ $? -ne 0 ]] && exit 1
|
||||||
@ -1070,6 +1074,7 @@ echo "hostapd command-line interface: hostapd_cli -p $CONFDIR/hostapd_ctrl"
|
|||||||
|
|
||||||
# from now on we exit with 0 on SIGINT
|
# from now on we exit with 0 on SIGINT
|
||||||
trap "clean_exit" SIGINT
|
trap "clean_exit" SIGINT
|
||||||
|
trap "clean_exit" SIGUSR1
|
||||||
|
|
||||||
hostapd $CONFDIR/hostapd.conf &
|
hostapd $CONFDIR/hostapd.conf &
|
||||||
HOSTAPD_PID=$!
|
HOSTAPD_PID=$!
|
||||||
|
Reference in New Issue
Block a user