Group :: System/Kernel and hardware
RPM: hostapd
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
#!/bin/sh
#
# chkconfig: 2345 11 89
# description: The daemon supports a so called Host AP mode, i.e., \
# it takes care of IEEE 802.11 management functions in \
# the host computer and acts as an access point.
# config: /etc/hostapd/hostapd.conf
# config: /etc/hostapd/hostapd.accept
# config: /etc/hostapd/hostapd.deny
# pidfile: /var/run/hostapd.pid
# author: Alexei Takaseev <taf@altlinux.ru>
# version: 2004100700
# changed: 2004100700 cleanup script
# changed: 2003093000 initialize release
# Source function library
WITHOUT_RC_COMPAT=1
. /etc/init.d/functions
# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network
# check if the config files are present
[ -f /etc/hostapd/hostapd.conf ] || exit 0
[ -f /etc/hostapd/hostapd.accept ] || exit 0
[ -f /etc/hostapd/hostapd.deny ] || exit 0
# Source service configuration.
SourceIfNotEmpty /etc/sysconfig/hostapd
PIDFILE=/var/run/hostapd.pid
LOCKFILE=/var/lock/subsys/hostapd
RETVAL=0
start() {
is_yes "$NETWORKING" || return 0
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- hostapd -P "$PIDFILE" $HOSTAPD_OPTIONS
RETVAL=$?
return $RETVAL
}
stop() {
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root hostapd
RETVAL=$?
return $RETVAL
}
restart() {
stop
start
}
reload() {
msg_reloading hostapd
stop_daemon --expect-user root -HUP hostapd
RETVAL=$?
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
condrestart)
if [ -e /var/lock/subsys/hostapd ]; then
restart
fi
;;
condreload)
if [ -e /var/lock/subsys/hostapd ]; then
reload
fi
;;
condstop)
if [ -e /var/lock/subsys/hostapd ]; then
stop
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root hostapd
RETVAL=$?
;;
*)
echo $"Usage: hostapd {start|stop|restart|reload|condrestart|condreload|condstop|status}"
RETVAL=1
esac
exit $RETVAL