libexec/rc.d/hostapd: Down/up interface when interface is specified
When no interface is specified results in a syntax error in the rc
script. Only execute poststart when an interface has been specified.
PR: 263358
Submitted by: markj
Reported by: Joshua Kinard <freebsd@kumba.dev>
Fixes: 0da2c91e64
MFC after: 3 days
This commit is contained in:
parent
797b94504f
commit
1452bfcd9b
@ -15,9 +15,11 @@ command=${hostapd_program}
|
|||||||
start_postcmd="hostapd_poststart"
|
start_postcmd="hostapd_poststart"
|
||||||
|
|
||||||
hostapd_poststart() {
|
hostapd_poststart() {
|
||||||
ifconfig ${ifn} down
|
if [ -n "$ifn" ]; then
|
||||||
sleep 2
|
ifconfig ${ifn} down
|
||||||
ifconfig ${ifn} up
|
sleep 2
|
||||||
|
ifconfig ${ifn} up
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ifn="$2"
|
ifn="$2"
|
||||||
|
Loading…
Reference in New Issue
Block a user