source: clfs-embedded/bootscripts/clfs/rc.d/init.d/hostapd@ 5c80a16

Last change on this file since 5c80a16 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
Line 
1#!/bin/ash
2
3# Hostapd Startup Script
4#
5
6. /etc/rc.d/init.d/functions
7
8PIDFILE=/var/run/hostapd.pid
9
10if [ ! -x /usr/sbin/hostapd ]; then
11 echo -n "Starting hostapd: /usr/sbin/hostapd not found "
12 false
13 check_status
14 exit 0
15fi
16
17if [ ! -f /etc/hostapd.conf ]; then
18 echo -n "Starting hostapd: /etc/hostapd.conf not found "
19 false
20 check_status
21fi
22
23case "$1" in
24start)
25 echo -n "Starting hostapd: "
26 hostapd -P "$PIDFILE" -B /etc/hostapd.conf
27 check_status
28 ;;
29stop)
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 ;;
38restart)
39 $0 stop
40 $0 start
41 ;;
42status)
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
52esac
Note: See TracBrowser for help on using the repository browser.