Blame SOURCES/hostapd.init

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