Last change
on this file since 5ac6f32 was fcb2663, checked in by Maarten Lankhorst <mlankhorst@…>, 15 years ago |
bootscripts: Really die in hostapd if config not found
|
-
Property mode
set to
100755
|
File size:
862 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
|
---|
[fcb2663] | 21 | exit 0
|
---|
[884672b] | 22 | fi
|
---|
| 23 |
|
---|
| 24 | case "$1" in
|
---|
| 25 | start)
|
---|
| 26 | echo -n "Starting hostapd: "
|
---|
| 27 | hostapd -P "$PIDFILE" -B /etc/hostapd.conf
|
---|
| 28 | check_status
|
---|
| 29 | ;;
|
---|
| 30 | stop)
|
---|
| 31 | if [ -r "$PIDFILE" ]; then
|
---|
| 32 | echo -n "Stopping hostapd: "
|
---|
| 33 | kill `cat "$PIDFILE"`
|
---|
| 34 | check_status
|
---|
| 35 | else
|
---|
| 36 | echo "Service hostapd not running."
|
---|
| 37 | fi
|
---|
| 38 | ;;
|
---|
| 39 | restart)
|
---|
| 40 | $0 stop
|
---|
| 41 | $0 start
|
---|
| 42 | ;;
|
---|
| 43 | status)
|
---|
| 44 | if [ -r "$PIDFILE" ]; then
|
---|
| 45 | echo "Service hostapd running (PID $(cat "$PIDFILE"))."
|
---|
| 46 | else
|
---|
| 47 | echo "Service hostapd not running."
|
---|
| 48 | fi
|
---|
| 49 | ;;
|
---|
| 50 | *)
|
---|
| 51 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
| 52 | exit 1
|
---|
| 53 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.