hostapd.initd 924 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2006 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. # $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-0.6.9-init.d,v 1.2 2009/05/17 10:18:18 gurligebis Exp $
  5. extra_started_commands="reload"
  6. depend() {
  7. need net
  8. after firewall
  9. use logger
  10. }
  11. checkconfig() {
  12. local file
  13. for file in ${CONFIGS}; do
  14. if [ ! -r "${file}" ]; then
  15. eerror "hostapd configuration file (${CONFIG}) not found"
  16. return 1
  17. fi
  18. done
  19. }
  20. start() {
  21. checkconfig || return 1
  22. ebegin "Starting ${SVCNAME}"
  23. start-stop-daemon --start --exec /usr/sbin/hostapd \
  24. -- -B ${OPTIONS} ${CONFIGS}
  25. eend $?
  26. }
  27. stop() {
  28. ebegin "Stopping ${SVCNAME}"
  29. start-stop-daemon --stop --exec /usr/sbin/hostapd
  30. eend $?
  31. }
  32. reload() {
  33. checkconfig || return 1
  34. ebegin "Reloading ${SVCNAME} configuration"
  35. kill -HUP $(pidof /usr/sbin/hostapd) > /dev/null 2>&1
  36. eend $?
  37. }