SourceForge.net Logo

B.23. /etc/init.d/hostapd

#!/bin/ash

# GPL $Id: hostapd,v 1.3 2005/03/31 04:40:52 cvonk Exp $
# system init for WPA Authenticator (hostapd)

case "$1" in
    start)
	echo -n " ath0"
        hostapd -B /etc/sysconfig/hostapd.conf 2>/dev/null >/dev/null
        ;;
    stop)
        killall hostapd 2>/dev/null
        ;;
    restart)
	$0 stop
	$0 start
	;;
    status)
        if pidof l2tpd | sed "s/$$\$//" | grep -q [0-9] ; then
	    echo "running"
        else
	    echo "stopped"
        fi
        ;;
esac

Example B.23. /etc/init.d/hostapd