| 1 | #!/bin/sh
|
|---|
| 2 | # Begin $rc_base/init.d/wpa-init
|
|---|
| 3 |
|
|---|
| 4 | # Based on:
|
|---|
| 5 | #sysklogd script from LFS-6.1 and earlier.
|
|---|
| 6 | #dhcpcd service script from LFS-6.1.1
|
|---|
| 7 | # Rewritten by Eloi Primaux
|
|---|
| 8 |
|
|---|
| 9 | #$LastChangedBy: eloi $
|
|---|
| 10 | #$Date: 2006-03-31 -0100 21:03:42 (Fri, 31 Mar 2006) $
|
|---|
| 11 | #$Date: 2006-09-23 -0100 23:05:55
|
|---|
| 12 |
|
|---|
| 13 | . /etc/sysconfig/rc
|
|---|
| 14 | . $rc_functions
|
|---|
| 15 | . /etc/profile
|
|---|
| 16 | . /etc/sysconfig/wpa_supplicant/wpa_service.conf
|
|---|
| 17 |
|
|---|
| 18 | #WPA_GLOBAL_FILE=/var/run/wpa_supplicant-global
|
|---|
| 19 | #WPA_ACCESS_DIR=/var/run/wpa_supplicant
|
|---|
| 20 | #WPA_PID_FILE=/var/run/wpa_supplicant.pid
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | #wpa_supplicant process must be unique
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | case "$1" in
|
|---|
| 27 | start)
|
|---|
| 28 | boot_mesg "Starting wpa_supplicant..."
|
|---|
| 29 |
|
|---|
| 30 | loadproc $WPA_DAEMON_NAME -g$WPA_GLOBAL_FILE -P$WPA_PID_FILE -B
|
|---|
| 31 | ;;
|
|---|
| 32 |
|
|---|
| 33 | stop)
|
|---|
| 34 | boot_mesg "Stopping wpa_supplicant..."
|
|---|
| 35 | killproc wpa_supplicant
|
|---|
| 36 | rm -fr $WPA_GLOBAL_FILE $WPA_PID_FILE $WPA_ACCESS_DIR > /dev/null
|
|---|
| 37 | ;;
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 | restart)
|
|---|
| 41 | $0 stop
|
|---|
| 42 | sleep 5
|
|---|
| 43 | $0 start
|
|---|
| 44 | ;;
|
|---|
| 45 |
|
|---|
| 46 | *)
|
|---|
| 47 | echo "Usage: $0 {start|stop|restart}"
|
|---|
| 48 | exit 1
|
|---|
| 49 | ;;
|
|---|
| 50 | esac
|
|---|
| 51 |
|
|---|
| 52 | # End $rc_base/init.d/wpa-init
|
|---|