Blame SOURCES/hostapd.init

264ba8
#!/bin/bash
264ba8
#
264ba8
# hostapd 
264ba8
#
264ba8
# chkconfig:   - 23 88
264ba8
# description: hostapd is a user space daemon for access point and
264ba8
#     authentication servers.  It implements IEEE 802.11 access point
264ba8
#     management, IEEE 802.1X/WPA/WPA2/EAP Authenticators and RADIUS
264ba8
#     authentication server.
264ba8
# processname: hostapd
264ba8
# config:      /etc/hostapd/hostapd.conf
264ba8
#
264ba8
### BEGIN INIT INFO
264ba8
# Provides: hostapd
264ba8
# Required-Start: $network
264ba8
# Required-Stop: $network
264ba8
# Default-Start:
264ba8
# Default-Stop: 0 1 6
264ba8
# Short-Description: start and stop hostapd
264ba8
# Description: IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
264ba8
### END INIT INFO
264ba8
264ba8
# Source function library.
264ba8
. /etc/rc.d/init.d/functions
264ba8
264ba8
# Source networking configuration.
264ba8
. /etc/sysconfig/network
264ba8
264ba8
exec="/usr/sbin/hostapd"
264ba8
prog=hostapd
264ba8
conf="/etc/hostapd/hostapd.conf"
264ba8
lockfile=/var/lock/subsys/$prog
264ba8
264ba8
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
264ba8
264ba8
start() {
264ba8
 	echo -n $"Starting $prog: $conf"
264ba8
	daemon $prog -B $OTHER_ARGS $conf
264ba8
	retval=$?
264ba8
	echo
264ba8
	[ $retval -eq 0 ] && touch $lockfile
264ba8
	return $retval
264ba8
}
264ba8
264ba8
stop() {
264ba8
	echo -n $"Stopping $prog: "
264ba8
	killproc $prog
264ba8
	retval=$?
264ba8
	echo
264ba8
	[ $retval -eq 0 ] && rm -f $lockfile
264ba8
	return $retval
264ba8
}
264ba8
264ba8
restart() {
264ba8
	stop
264ba8
	start
264ba8
}
264ba8
264ba8
reload() {
264ba8
	restart
264ba8
}
264ba8
264ba8
force_reload() {
264ba8
	restart
264ba8
}
264ba8
264ba8
fdr_status() {
264ba8
	status $prog
264ba8
}
264ba8
264ba8
264ba8
case "$1" in
264ba8
	start|stop|restart|reload)
264ba8
  		$1
264ba8
		;;
264ba8
	force-reload)
264ba8
		force_reload
264ba8
		;;
264ba8
	status)
264ba8
		fdr_status
264ba8
		;;
264ba8
	condrestart|try-restart)
264ba8
		[ -f $lockfile ] && restart
264ba8
		;;
264ba8
	*)
264ba8
		echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
264ba8
		exit 1
264ba8
esac
264ba8