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