Blame SOURCES/hostapd.init

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