Sophie

Sophie

distrib > Mageia > 2 > i586 > media > core-updates > by-pkgid > a2e6ba19d57d6ca6b55d9a4b64ee8ce6 > files > 4

hostapd-0.7.3-4.1.mga2.i586.rpm

#!/bin/sh
#
# Startup script for Hostapd
#
# author: Laurent Culioli <laurent@mandrake.org>
#
# chkconfig: 345 90 15
# description: Hostapd UserSpace Daemon
# processname: hostapd

# Source function library.
. /etc/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 

RETVAL=0

# Path to the hostapd binary.
hostapd=/usr/sbin/hostapd

start() {
        gprintf "Starting Hostapd: "
        params="/etc/hostapd/hostapd.conf -B"
        daemon --check hostapd $hostapd $params
        touch /var/lock/subsys/hostapd
        echo
}

stop() {
        gprintf "Stopping Hostapd: "
        killproc $hostapd
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/hostapd
        echo
}

reload() {
        gprintf "Reloading Hostapd: "
        killproc $hostapd -HUP
        echo
}

# See how we were called.
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        reload)
                reload
                ;;
        restart)
                stop
                start
                ;;
        status)
                status hostapd
                ;;
        *)
                gprintf "Usage: hostapd {start|stop|restart|reload|status}\n"
                RETVAL=1
esac
exit $RETVAL