#!/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