source: trunk/debian/package/hostapd/debian/hostapd.init @ 517

Last change on this file since 517 was 517, checked in by amain, 6 years ago

Merge contrib branch 340:516. Main features added:

  • updated plugin architecture
  • improved patch system
  • bitten continous integration support
  • sever build fixed over time to remain in sync with OpenWrt
File size: 1.4 KB
Line 
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides:             hostapd
5# Required-Start:
6# Required-Stop:
7# Should-Start:         $local_fs
8# Should-Stop:          $local_fs
9# Default-Start:        S
10# Default-Stop:         0 6
11# X-Start-Before:       $network
12# X-Stop-After:         $network
13# Short-Description:    Advanced IEEE 802.11 management daemon
14# Description:          Userspace IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP
15#                       Authenticator
16### END INIT INFO
17
18PATH=/sbin:/bin:/usr/sbin:/usr/bin
19DAEMON=/usr/sbin/hostapd
20NAME=hostapd
21DESC="advanced IEEE 802.11 management"
22PIDFILE=/var/run/hostapd.pid
23
24test -x $DAEMON || exit 0
25
26if [ -s /etc/default/hostapd ] ; then
27        . /etc/default/hostapd
28fi
29
30if [ -z "$DAEMON_CONF" ]; then
31        DAEMON_CONF=/etc/hostapd/hostapd-wpa.conf
32fi
33
34DAEMON_OPTS="-B -P $PIDFILE $DAEMON_OPTS $DAEMON_CONF"
35
36. /lib/lsb/init-functions
37
38case "$1" in
39  start)
40        log_daemon_msg "Starting $DESC"
41        log_progress_msg "$NAME"
42        if [ "$RUN_DAEMON" != "yes" ]; then
43                log_progress_msg "disabled via /etc/default/hostapd"
44                log_end_msg 0
45                exit 0
46        fi
47        start-stop-daemon --start --oknodo --quiet \
48                --exec $DAEMON --pidfile $PIDFILE -- $DAEMON_OPTS > /dev/null
49        log_end_msg "$?"
50        ;;
51  stop)
52        log_daemon_msg "Stopping $DESC"
53        log_progress_msg "$NAME"
54        start-stop-daemon --stop --oknodo --quiet \
55                --exec $DAEMON --pidfile $PIDFILE
56        log_end_msg "$?"
57        ;;
58  *)
59        N=/etc/init.d/$NAME
60        echo "Usage: $N {start|stop}" >&2
61        exit 1
62        ;;
63esac
64
65exit 0
Note: See TracBrowser for help on using the repository browser.