wok view hostapd/stuff/hostapd @ rev 25037

Up glza (0.11.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 21:38:29 2022 +0000 (23 months ago)
parents 7f188676b59c
children
line source
1 #!/bin/sh
2 # /etc/init.d/hostapd: Start, stop and restart hostapd on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=hostapd
10 DESC="$(_ 'daemon for wireless software access points')"
11 DAEMON=/usr/bin/hostapd
12 PIDFILE=/var/run/hostapd.pid
13 OPTIONS="$HOSTAPD_OPTIONS"
14 [ -n "$HOSTAPD_OPTIONS" ] ||
15 OPTIONS="-B -P $PIDFILE /etc/hostapd/hostapd.conf"
17 case "$1" in
18 (start)
19 if active_pidfile $PIDFILE hostapd
20 then
21 _ '%s is already running.' $NAME
22 exit 1
23 fi
24 action 'Starting %s: %s...' "$DESC" $NAME
25 $DAEMON $OPTIONS
26 status
27 ;;
28 (stop)
29 if ! active_pidfile $PIDFILE hostapd
30 then
31 _ '%s is not running.' $NAME
32 exit 1
33 fi
34 action 'Stopping %s: %s...' "$DESC" $NAME
35 kill $(cat $PIDFILE)
36 status
37 ;;
38 (restart)
39 if ! active_pidfile $PIDFILE hostapd
40 then
41 _ '%s is not running.' $NAME
42 exit 1
43 fi
44 action 'Restarting %s: %s...' "$DESC" $NAME
45 kill $(cat $PIDFILE)
46 sleep 2
47 $DAEMON $OPTIONS
48 status
49 ;;
50 (*)
51 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
52 newline
53 exit 1
54 ;;
55 esac
57 exit 0