diff --git a/etc/conf.d/hostapd b/etc/conf.d/hostapd new file mode 100644 index 0000000..cf3ec58 --- /dev/null +++ b/etc/conf.d/hostapd @@ -0,0 +1,2 @@ +HOSTAPD_PID=/var/run/hostapd.pid +HOSTAPD_CONF=/etc/hostapd/hostapd.conf diff --git a/etc/rc.d/hostapd b/etc/rc.d/hostapd index 7473bfa..6dd920f 100755 --- a/etc/rc.d/hostapd +++ b/etc/rc.d/hostapd @@ -2,11 +2,12 @@ . /etc/rc.conf . /etc/rc.d/functions +. /etc/conf.d/hostapd case "$1" in start) stat_busy "Starting hostapd" - /usr/bin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf &> /dev/null + /usr/bin/hostapd -B -P ${HOSTAPD_PID} ${HOSTAPD_CONF} &> /dev/null if [ $? -gt 0 ]; then stat_fail else @@ -16,7 +17,7 @@ case "$1" in ;; stop) stat_busy "Stopping hostapd" - [ -f /var/run/hostapd.pid ] && kill `cat /var/run/hostapd.pid` &> /dev/null + [ -f ${HOSTAPD_PID} ] && kill `cat ${HOSTPAD_CONF}` &> /dev/null if [ $? -gt 0 ]; then stat_fail else