Blame SOURCES/hostapd.init

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