~ubuntu-branches/ubuntu/oneiric/wpasupplicant/oneiric

« back to all changes in this revision

Viewing changes to debian/init.d/wpasupplicant

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2006-10-05 08:04:01 UTC
  • mfrom: (1.2.1 upstream) (2.1.14 edgy)
  • Revision ID: james.westby@ubuntu.com-20061005080401-myfwjtq7di70dyeo
* Update madwifi headers to latest SVN. (Closes: #388316)
* Remove failed attempt at action locking. [debian/functions.sh,
  debian/wpa_action.sh]
* Add hysteresis checking functions, to avoid "event loops" while
  using wpa-roam. [debian/functions.sh, debian/wpa_action.sh]
* Change of co-maintainer email address.
* Add ishex() function to functions.sh to determine wpa-psk value type in
  plaintext or hex. This effectively eliminates the need for the bogus and
  somewhat confusing wpa-passphrase contruct specific to our scripts and
  allows wpa-psk to work with either a 8 to 63 character long plaintext
  string or 64 character long hex string.
* Adjust README.modes to not refer to the redundant wpa-passphrase stuff.
* Add big fat NOTE about acceptable wpa-psk's to top of example gallery.
* Strip surrounding quotes from wpa-ssid if present, instead of just whining
  about them.
* Update email address in copyright blurb of functions.sh, ifupdown.sh and
  wpa_action.sh.  

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