Last change
on this file since 884672b was 884672b, checked in by Maarten Lankhorst <mlankhorst@…>, 15 years ago |
book: Add hostapd and libnl to beyond section
|
-
Property mode
set to
100755
|
File size:
854 bytes
|
Rev | Line | |
---|
[884672b] | 1 | #!/bin/ash
|
---|
| 2 |
|
---|
| 3 | # Hostapd Startup Script
|
---|
| 4 | #
|
---|
| 5 |
|
---|
| 6 | . /etc/rc.d/init.d/functions
|
---|
| 7 |
|
---|
| 8 | PIDFILE=/var/run/hostapd.pid
|
---|
| 9 |
|
---|
| 10 | if [ ! -x /usr/sbin/hostapd ]; then
|
---|
| 11 | echo -n "Starting hostapd: /usr/sbin/hostapd not found "
|
---|
| 12 | false
|
---|
| 13 | check_status
|
---|
| 14 | exit 0
|
---|
| 15 | fi
|
---|
| 16 |
|
---|
| 17 | if [ ! -f /etc/hostapd.conf ]; then
|
---|
| 18 | echo -n "Starting hostapd: /etc/hostapd.conf not found "
|
---|
| 19 | false
|
---|
| 20 | check_status
|
---|
| 21 | fi
|
---|
| 22 |
|
---|
| 23 | case "$1" in
|
---|
| 24 | start)
|
---|
| 25 | echo -n "Starting hostapd: "
|
---|
| 26 | hostapd -P "$PIDFILE" -B /etc/hostapd.conf
|
---|
| 27 | check_status
|
---|
| 28 | ;;
|
---|
| 29 | stop)
|
---|
| 30 | if [ -r "$PIDFILE" ]; then
|
---|
| 31 | echo -n "Stopping hostapd: "
|
---|
| 32 | kill `cat "$PIDFILE"`
|
---|
| 33 | check_status
|
---|
| 34 | else
|
---|
| 35 | echo "Service hostapd not running."
|
---|
| 36 | fi
|
---|
| 37 | ;;
|
---|
| 38 | restart)
|
---|
| 39 | $0 stop
|
---|
| 40 | $0 start
|
---|
| 41 | ;;
|
---|
| 42 | status)
|
---|
| 43 | if [ -r "$PIDFILE" ]; then
|
---|
| 44 | echo "Service hostapd running (PID $(cat "$PIDFILE"))."
|
---|
| 45 | else
|
---|
| 46 | echo "Service hostapd not running."
|
---|
| 47 | fi
|
---|
| 48 | ;;
|
---|
| 49 | *)
|
---|
| 50 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
| 51 | exit 1
|
---|
| 52 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.