summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-1.0/wpa-supplicant.sh
diff options
context:
space:
mode:
authorCristian Iorga <cristian.iorga@intel.com>2012-07-18 15:36:28 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-19 17:18:11 +0100
commit4f2da78be65eba3760142144ad7ba6abef8408f4 (patch)
treee608e8333af0306bade03dd7114f62fea93247de /meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-1.0/wpa-supplicant.sh
parent90fbd7f6b1c462a179af2fb537a6b401402a798e (diff)
downloadpoky-4f2da78be65eba3760142144ad7ba6abef8408f4.tar.gz
wpa-supplicant: upgrade to 1.0
README file is changed. Some phrases were reformulated, but the semanthics are the same. Copyright has been renewed. Both licenses (GPL v2 and BSD) have been added explicitly. wpa_supplicant.c is changed regarding licenses body. Copyright has been renewed. (From OE-Core rev: 3c02800716aafbc12b15b3dbb3bad0dc3b942cc1) Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-1.0/wpa-supplicant.sh')
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-1.0/wpa-supplicant.sh85
1 files changed, 85 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-1.0/wpa-supplicant.sh b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-1.0/wpa-supplicant.sh
new file mode 100644
index 0000000000..5c9e5d33a7
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-1.0/wpa-supplicant.sh
@@ -0,0 +1,85 @@
1#!/bin/sh
2
3
4WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
5WPA_SUP_PNAME="wpa_supplicant"
6WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
7WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $IFACE"
8
9VERBOSITY=0
10
11
12if [ -s "$IF_WPA_CONF" ]; then
13 WPA_SUP_CONF="-c $IF_WPA_CONF"
14else
15 exit 0
16fi
17
18if [ ! -x "$WPA_SUP_BIN" ]; then
19
20 if [ "$VERBOSITY" = "1" ]; then
21 echo "$WPA_SUP_PNAME: binaries not executable or missing from $WPA_SUP_BIN"
22 fi
23
24 exit 1
25fi
26
27if [ "$MODE" = "start" ] ; then
28 # driver type of interface, defaults to wext when undefined
29 if [ -s "/etc/wpa_supplicant/driver.$IFACE" ]; then
30 IF_WPA_DRIVER=$(cat "/etc/wpa_supplicant/driver.$IFACE")
31 elif [ -z "$IF_WPA_DRIVER" ]; then
32
33 if [ "$VERBOSITY" = "1" ]; then
34 echo "$WPA_SUP_PNAME: wpa-driver not provided, using \"wext\""
35 fi
36
37 IF_WPA_DRIVER="wext"
38 fi
39
40 # if we have passed the criteria, start wpa_supplicant
41 if [ -n "$WPA_SUP_CONF" ]; then
42
43 if [ "$VERBOSITY" = "1" ]; then
44 echo "$WPA_SUP_PNAME: $WPA_SUP_BIN $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER"
45 fi
46
47 start-stop-daemon --start --quiet \
48 --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \
49 -- $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER
50 fi
51
52 # if the interface socket exists, then wpa_supplicant was invoked successfully
53 if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
54
55 if [ "$VERBOSITY" = "1" ]; then
56 echo "$WPA_SUP_PNAME: ctrl_interface socket located at $WPA_COMMON_CTRL_IFACE/$IFACE"
57 fi
58
59 exit 0
60
61 fi
62
63elif [ "$MODE" = "stop" ]; then
64
65 if [ -f "$WPA_SUP_PIDFILE" ]; then
66
67 if [ "$VERBOSITY" = "1" ]; then
68 echo "$WPA_SUP_PNAME: terminating $WPA_SUP_PNAME daemon"
69 fi
70
71 start-stop-daemon --stop --quiet \
72 --name $WPA_SUP_PNAME --pidfile $WPA_SUP_PIDFILE
73
74 if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
75 rm -f $WPA_COMMON_CTRL_IFACE/$IFACE
76 fi
77
78 if [ -f "$WPA_SUP_PIDFILE" ]; then
79 rm -f $WPA_SUP_PIDFILE
80 fi
81 fi
82
83fi
84
85exit 0