]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/initscripts/networking/wpa_supplicant.exe
update Tor to 0.3.5.8
[people/pmueller/ipfire-2.x.git] / src / initscripts / networking / wpa_supplicant.exe
CommitLineData
71ea0d68
SS
1#!/bin/bash
2########################################################################
3# Begin
4#
5# Description : wpa_supplicant Script
6#
7# Authors : IPFire Development Team <developers@ipfire.org>
8#
9# Version : 01.00
10#
11# Notes : This script starts/stops the dhclient if a WPA/WPA2
12# connection to an AP successfull has been established
13# or disconnected.
14#
15########################################################################
16
17. /etc/sysconfig/rc
18. ${rc_functions}
19. /etc/init.d/networking/functions.network
20
21# Gather required information from wpa_cli.
22device="$1"
23wpa_state="$2"
24
25# Check if the RED device has been configured to use DHCP or exit immediately.
26eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
27if [ ! "${RED_TYPE}" == "DHCP" ] ; then
28 exit 0
29fi
30
31case "${wpa_state}" in
32 CONNECTED)
33 # Start dhcpcd.
34 dhcpcd_start "${device}"
35
36 exit 0
37 ;;
38
39 DISCONNECTED)
40 # Stop dhcpcd.
41 dhcpcd_stop "${device}"
42
43 exit 0
44 ;;
45
46 *)
47 # When we ever got here, there is a really big problem.
48 exit 1
49 ;;
50esac