~ubuntu-branches/ubuntu/gutsy/wpasupplicant/gutsy

« back to all changes in this revision

Viewing changes to debian/wpa_action.sh

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Alexander Sack
  • Date: 2007-08-26 16:06:57 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070826160657-2m8pxoweuxe8f93t
Tags: 0.6.0+0.5.8-0ubuntu1
* New upstream release
* remove patch 11_erroneous_manpage_ref, applied upstream
* remove patch 25_wpas_dbus_unregister_iface_fix, applied upstream

[ Alexander Sack ]
* bumping upstream version to replace development version 0.6.0 with
  this package from stable release branch.
* attempt to fix wierd timeout and high latency issues by going
  back to stable upstream version (0.5.9) (LP: #140763,
  LP: #141233).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Copyright (C) 2006 Debian/Ubuntu wpasupplicant Maintainers 
 
4
# <pkg-wpa-devel@lists.alioth.debian.org>
 
5
#
 
6
# This program is free software; you can redistribute it and/or
 
7
# modify it under the terms of the GNU General Public License
 
8
# as published by the Free Software Foundation; either version 2
 
9
# of the License, or (at your option) any later version.
 
10
#
 
11
# This program is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
# GNU General Public License for more details.
 
15
#
 
16
# On Debian GNU/Linux systems, the text of the GPL license can be
 
17
# found in /usr/share/common-licenses/GPL.
 
18
 
 
19
if [ -n "$IF_WPA_ROAM_MAINT_DEBUG" ]; then
 
20
        set -x
 
21
fi
 
22
 
 
23
if [ -z "$1" ] || [ -z "$2" ]; then
 
24
        echo "Usage: $0 IFACE ACTION"
 
25
        exit 1
 
26
fi
 
27
 
 
28
# network interface
 
29
WPA_IFACE="$1"
 
30
# [CONNECTED|DISCONNECTED|stop|reload|check]
 
31
WPA_ACTION="$2"
 
32
 
 
33
if [ -f /etc/wpa_supplicant/functions.sh ]; then
 
34
        . /etc/wpa_supplicant/functions.sh
 
35
else
 
36
        exit 0
 
37
fi
 
38
 
 
39
case "$WPA_ACTION" in
 
40
        "CONNECTED")
 
41
                wpa_log_init
 
42
                wpa_hysteresis_check || exit 1
 
43
                wpa_log_action
 
44
                wpa_log_environment
 
45
                if ifupdown_check; then
 
46
                        ifup
 
47
                fi
 
48
                wpa_hysteresis_event
 
49
                wpa_cli status
 
50
                ;;
 
51
 
 
52
        "DISCONNECTED")
 
53
                wpa_log_init
 
54
                wpa_hysteresis_check || exit 1
 
55
                wpa_log_action
 
56
                wpa_log_environment
 
57
                if ifupdown_check; then
 
58
                        ifdown
 
59
                        if_post_down_up
 
60
                fi
 
61
                ;;
 
62
 
 
63
        "stop"|"down")
 
64
                test_wpa_supplicant || exit 1
 
65
                kill_wpa_cli
 
66
                if ifupdown_check; then
 
67
                        ifdown
 
68
                fi
 
69
                kill_wpa_supplicant
 
70
                wpa_log_init
 
71
                wpa_log_action
 
72
                ;;
 
73
 
 
74
        "restart"|"reload")
 
75
                test_wpa_supplicant || exit 1
 
76
                reload_wpa_supplicant
 
77
                wpa_log_init
 
78
                wpa_log_action
 
79
                ;;
 
80
        
 
81
        "check")
 
82
                test_wpa_supplicant || exit 1
 
83
                test_wpa_cli || exit 1
 
84
                ;;
 
85
 
 
86
        *)
 
87
                echo "Unknown action: \"$WPA_ACTION\""
 
88
                exit 1
 
89
                ;;
 
90
esac
 
91
 
 
92
exit 0