~ubuntu-branches/ubuntu/lucid/wpasupplicant/lucid-updates

« back to all changes in this revision

Viewing changes to debian/init.d/wpasupplicant

  • Committer: Bazaar Package Importer
  • Author(s): Kyle McMartin
  • Date: 2005-02-15 00:51:28 UTC
  • Revision ID: james.westby@ubuntu.com-20050215005128-4cnlxpp3vc3synqq
Tags: 0.3.8-1
* New upstream release.
* This release fixes a crash due to a buffer overflow, caused by
  a missing validation step on EAPOL-Key frames. Receiving malformed
  frames trigger the crash. More information available in the notes:
  http://lists.shmoo.com/pipermail/hostap/2005-February/009465.html
* Fix some badness with the init script. Missed the -B option
  to daemonize wpa_supplicant... pidfile is not currently being used
  as it requires modifying wpa_supplicant.
* patches/
  - 12_ipw_open_aps (closes: #295143)
    + merge patch against driver_ipw to fix association with
      open access points.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Buyer beware! This is really only useful if you have a 
 
4
# MiniPCI or other permanent wireless device.
 
5
 
 
6
# However, the wpa_supplicant daemon will start, and sit waiting
 
7
# for the name interface to come up. Therefore, if you want to use
 
8
# this with pcmcia or other nonsense, it may be best to ifrename
 
9
# your wireless interface if it has an "ethX" name that is variable.
 
10
 
 
11
PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
12
 
 
13
DAEMON=/usr/sbin/wpa_supplicant
 
14
PIDFILE="/var/run/wpasupplicant.pid"
 
15
CONFIG="/etc/wpa_supplicant.conf"
 
16
PNAME="wpa_supplicant"
 
17
 
 
18
# insane defaults
 
19
OPTIONS="-Bw" # daemonize and wait for interface
 
20
ENABLED=0
 
21
 
 
22
[ -f /etc/default/wpasupplicant ] && . /etc/default/wpasupplicant
 
23
 
 
24
if [ "$ENABLED" = "0" ]; then
 
25
        echo "wpasupplicant: disabled, see /etc/default/wpasupplicant"
 
26
        exit 0;
 
27
fi
 
28
 
 
29
[ -f $CONFIG ] || ( echo "No configuration file found, not starting."; \
 
30
        exit 1; )
 
31
 
 
32
[ -f $DAEMON ] || exit 0
 
33
 
 
34
set -e
 
35
 
 
36
case "$1" in
 
37
        start)
 
38
                echo -n "Starting wpasupplicant: "
 
39
                start-stop-daemon --start --name $PNAME \
 
40
                        --oknodo --startas $DAEMON -- -B $OPTIONS
 
41
                echo "done."
 
42
                ;;
 
43
        stop)
 
44
                echo -n "Stopping wpasupplicant: "
 
45
                start-stop-daemon --stop --name $PNAME \
 
46
                        --oknodo
 
47
                echo "done."
 
48
                if [ -f $PIDFILE ]; then
 
49
                        rm -f $PIDFILE;
 
50
                fi              
 
51
                ;;
 
52
        reload|force-reload)
 
53
                echo -n "Reloading wpasupplicant: "
 
54
                start-stop-daemon --stop --signal HUP \
 
55
                        --name $PNAME
 
56
                echo "done."
 
57
                ;;
 
58
        restart)
 
59
                echo -n "Restarting wpasupplicant: "
 
60
                start-stop-daemon --stop --name $PNAME \
 
61
                        --retry 5 --oknodo
 
62
                if [ -f $PIDFILE ]; then
 
63
                        rm -f $PIDFILE;
 
64
                fi              
 
65
                start-stop-daemon --start --name $PNAME \
 
66
                        --oknodo --startas $DAEMON -- -B $OPTIONS
 
67
                echo "done."
 
68
                ;;
 
69
        *)
 
70
                echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
 
71
                exit 1
 
72
                ;;
 
73
esac
 
74
 
 
75
exit 0