r1080 - trunk/ATTACHMENTS/wpa-service

robert at linuxfromscratch.org robert at linuxfromscratch.org
Thu Aug 9 02:40:36 PDT 2007


Author: robert
Date: 2007-08-09 03:40:36 -0600 (Thu, 09 Aug 2007)
New Revision: 1080

Added:
   trunk/ATTACHMENTS/wpa-service/wpa-service-0.24.tar.bz2
Removed:
   trunk/ATTACHMENTS/wpa-service/wpa-rcscript
   trunk/ATTACHMENTS/wpa-service/wpa-service
   trunk/ATTACHMENTS/wpa-service/wpa-service-iface
   trunk/ATTACHMENTS/wpa-service/wpa_actions-script
   trunk/ATTACHMENTS/wpa-service/wpa_service.conf
Log:
Updated wpa-service hint attachments

Deleted: trunk/ATTACHMENTS/wpa-service/wpa-rcscript
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-rcscript	2007-08-09 09:39:20 UTC (rev 1079)
+++ trunk/ATTACHMENTS/wpa-service/wpa-rcscript	2007-08-09 09:40:36 UTC (rev 1080)
@@ -1,52 +0,0 @@
-#!/bin/sh
-# Begin $rc_base/init.d/wpa-init
-
-# Based on:
-#sysklogd script from LFS-6.1 and earlier.
-#dhcpcd service script from LFS-6.1.1
-# Rewritten by Eloi Primaux
-
-#$LastChangedBy: eloi $
-#$Date: 2006-03-31 -0100 21:03:42 (Fri, 31 Mar 2006) $
-#$Date: 2006-09-23 -0100 23:05:55
-
-. /etc/sysconfig/rc
-. $rc_functions
-. /etc/profile
-. /etc/sysconfig/wpa_supplicant/wpa_service.conf
-
-#WPA_GLOBAL_FILE=/var/run/wpa_supplicant-global
-#WPA_ACCESS_DIR=/var/run/wpa_supplicant
-#WPA_PID_FILE=/var/run/wpa_supplicant.pid
-
-
-#wpa_supplicant process must be unique
-
-
-case "$1" in
-	start)
-		boot_mesg "Starting wpa_supplicant..."
-		
-		loadproc $WPA_DAEMON_NAME -g$WPA_GLOBAL_FILE -P$WPA_PID_FILE -B
-		;;
-
-	stop)
-		boot_mesg "Stopping wpa_supplicant..."
-		killproc wpa_supplicant
-		rm -fr $WPA_GLOBAL_FILE $WPA_PID_FILE $WPA_ACCESS_DIR > /dev/null
-		;;
-
-
-	restart)
-		$0 stop
-		sleep 5
-		$0 start
-		;;
-
-	*)
-		echo "Usage: $0 {start|stop|restart}"
-		exit 1
-		;;
-esac
-
-# End $rc_base/init.d/wpa-init

Deleted: trunk/ATTACHMENTS/wpa-service/wpa-service
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service	2007-08-09 09:39:20 UTC (rev 1079)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service	2007-08-09 09:40:36 UTC (rev 1080)
@@ -1,192 +0,0 @@
-#!/bin/bash
-# Begin $network-devices/services/wpa-service
-# wpa-service 0.21
-# Based on dhcpcd script adapted for wpa networks with or without dhcp support
-# Rewritten by Eloi Primaux  - eloi AT bliscat DOT org
-# 2006-02-20 First script
-# 2006-03-31 wpa-service is functional
-# 2006-08-21 version by Maarten Lankhorst - m.b.lankhorst.(@).gmail.com
-# 2006-10-15 0.2 release by Eloi Primaux
-#	     merging Maarten work into configure_network function
-#	     can use both wpa_cli -a function and ifplugd.
-# 2007-02-14 0.21 ifplugd support removed
-#            wait_for_up removed
-#            status* and available_network* functions removed
-
-IFACE=$1
-BRING=$2
-
-. /etc/sysconfig/rc
-. $rc_functions
-. $IFCONFIG
-. /etc/sysconfig/wpa_supplicant/wpa_service.conf
-
-function get_real_pid {
-	if [ -e $1 ]; then
-	RET=`fuser $1` &> /dev/null
-	else
-	return 1
-	fi
-}
-
-function wpa_is_up {
-	get_real_pid $WPA_GLOBAL_FILE
-	if [ $? != 0 ]; then
-		return 2
-	fi
-}
-
-function wpa {
-	wpa_is_up
-	if [ $? != 0 ]; then
-		verbose '' "$WPA_DAEMON_NAME isn't running, please check why"
-		if [ $BRING != "UP" ]; then
-			return 1
-		else
-			exit 1
-		fi
-	fi
-}
-
-function is_iface_not_managed {
-	[ -n "`get_real_pid $WPA_ACCESS_DIR/$IFACE`" ] && return 2
-}
-
-function verbose {
-	[ "$VERBOSE" == "YES" ] && boot_mesg $1 "$2"
-}
-
-function test_fail {
-	[ "$1" != 0 ] && RET="FAIL:$1"
-	verbose '' " $RET"
-	if [[ $RET = FAIL* ]]; then
-		echo_failure ; return 2
-	else
-		return $1
-	fi
-}
-
-function add_iface {
-	verbose -n "$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $IFACE '' $WPA_DRIVER $WPA_ACCESS_DIR :"
-	RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_add $IFACE '' $WPA_DRIVER $WPA_ACCESS_DIR` &> /dev/null
-	test_fail $?
-}
-
-function ctrl_iface {
-	verbose -n "$WPA_CLIENT_NAME -i$IFACE $@ :"
-	RET=`$WPA_CLIENT_NAME -i$IFACE $@` &> /dev/null
-	test_fail $?
-}
-
-function remove_iface {
-	verbose -n "$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $IFACE :"
-	RET=`$WPA_CLIENT_NAME -g$WPA_GLOBAL_FILE interface_remove $IFACE` &> /dev/null
-	test_fail $?
-}
-
-function configure_network {
-	#Read the wpa config file
-	LINENUMBER=0
-	CONFIGFILE="$WPA_CONFIG_DIR/$WPA_CONFIG_FILE"
-	LINES="$(wc -l $CONFIGFILE | sed 's/ .*//')"
-	while [ "$LINENUMBER" -lt "$LINES" ]
-	do
-		verbose '' "NETWORK=$NETWORK"
-		# Increase line number
-		let ++LINENUMBER
-		verbose '' "Parsing line ${LINENUMBER}"
-		# Fetch a line
-		preline="$(head -n $LINENUMBER $CONFIGFILE | tail -n 1)"
-		# Remove everything after a '#' (comment)
-		line="$(echo $preline | sed -e 's/#.*//')"
-
-		#echo "Parsing $LINENUMBER: '$preline' => '$line'"
-
-		if [ -z "`echo $line`" ]; then
-		# ignore now empty lines
-			continue
-		elif [ "$line" = "network={" ]; then
-		# creating a new network configuration,
-		# saving network number to NETWORK
-			ctrl_iface add_network
-			NETWORK="$RET"
-		elif [ "$line" = "}" ]; then
-		# now the network is configured, enabling it
-			ctrl_iface "enable_network $NETWORK"
-			unset NETWORK
-		elif [ -n "$( echo "$line" | grep -v "ctrl_interface")" ]; then
-			# all others lines should be network parameters...
-			# i need to replace the first '=' character by a pace
-			line="`echo "$line" | sed 's,=, ,'`"
-			verbose '' "ctrl_iface set_network $NETWORK $line"
-			RET="`$WPA_CLIENT_NAME -i $IFACE set_network $NETWORK $line`"
-			#ctrl_iface set_network $NETWORK $line
-		fi
-		if [[ $RET = FAIL* ]]; then
-			boot_mesg "Parse error on line ${LINENUMBER}"
-			remove_iface 
-			echo_failure
-			return 2
-		fi
-	done
-}
-
-function wait_for_events {
-# This is a new wpa_supplicant function: really usefull
-# but requires an additional action file to handle CONNECTED/DISCONNECTED events
-	ctrl_iface -a$WPA_ACTION_FILE &
-}
-
-
-function real_fail {
-	[ "$1" != 0 ] && RET="FAIL:$1"
-	verbose '' " $RET"
-	if [[ $RET = FAIL* ]]; then
-		exit $1
-	else
-		return $1
-	fi
-}
-
-function wait_for_up {
-	wait_for_up_loop
-	real_fail $?
-	$WPA_ACTION_FILE $IFACE CONNECTED
-}
-
-
-function iface_up {
-	wpa
-	is_iface_not_managed
-	if [ $? = 0 ]; then
-		verbose '' "Interface already managed, continuing"
-	else
-		add_iface
-		real_fail $?
-	fi
-	configure_network
-	real_fail $?
-	wait_for_events
-	}
-
-
-function iface_down {
-	wpa
-	ctrl_iface disconnect
-	test_fail $?
-		verbose '' "wpa_cli -a will exit when interface will be removed"
-		$WPA_ACTION_FILE $IFACE DISCONNECTED
-	test_fail $?
-	wpa_cli -g$WPA_GLOBAL_FILE interface_remove $IFACE
-	test_fail $?	
-}
-
-case "$2" in
-	up)
-	iface_up
-	;;
-	down)
-	iface_down
-	;;
-esac
-

Added: trunk/ATTACHMENTS/wpa-service/wpa-service-0.24.tar.bz2
===================================================================
(Binary files differ)


Property changes on: trunk/ATTACHMENTS/wpa-service/wpa-service-0.24.tar.bz2
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: trunk/ATTACHMENTS/wpa-service/wpa-service-iface
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa-service-iface	2007-08-09 09:39:20 UTC (rev 1079)
+++ trunk/ATTACHMENTS/wpa-service/wpa-service-iface	2007-08-09 09:40:36 UTC (rev 1080)
@@ -1,8 +0,0 @@
-ONBOOT="yes"
-SERVICE="wpa-service"
-VERBOSE="NO"
-	. /etc/sysconfig/wpa_supplicant/wpa_service.conf
-
-# Here you have to define which wpa driver wpa_supplicant will use for
-#this interface
-        WPA_DRIVER="madwifi"

Deleted: trunk/ATTACHMENTS/wpa-service/wpa_actions-script
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa_actions-script	2007-08-09 09:39:20 UTC (rev 1079)
+++ trunk/ATTACHMENTS/wpa-service/wpa_actions-script	2007-08-09 09:40:36 UTC (rev 1080)
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-IFACE=$1
-EVENT=$2
-
-. /etc/sysconfig/wpa_supplicant/wpa_service.conf
-
-# already set...
-#NETWORKDIR=/etc/sysconfig/network.d
-#SERVICESDIR=/etc/sysconfig/network-devices/services
-
-. /etc/sysconfig/rc
-. $rc_functions
-. $IFCONFIG
-
-. /etc/rc.d/init.d/functions
-. /etc/sysconfig/network-devices/ifconfig.$IFACE/wpa-service
-
-
-function verbose {
-	[ "$VERBOSE" == "YES" ] && boot_mesg $1 "$2"
-}
-
-function test_fail {
-	[ "$1" != 0 ] && RET="FAIL:$1"
-	verbose '' " $RET"
-	if [[ $RET = FAIL* ]]; then
-		echo_failure ; return 2
-	else
-		return $1
-	fi
-}
-
-function get_ssid {
-	RET=`$WPA_CLIENT_NAME -i$IFACE status | grep ^ssid= | cut -f2- -d=` &> /dev/null
-}
-
-if [ "$EVENT" == "CONNECTED" ]; then
-	get_ssid
-	SSID=$RET
-	verbose '' "SSID is $SSID"
-	# configure network, signal DHCP client, etc.
-	# If special networks definition exist, use it
-	if [ -f "$NETWORKDIR/$SSID" ]; then
-		IFCONFIG="$NETWORKDIR/$SSID"
-		. $IFCONFIG
-		export IFCONFIG
-		$SERVICESDIR/$SERVICE $IFACE up
-	else
-		IFCONFIG="$NETWORKDIR/AUTO"
-		. $IFCONFIG
-		export IFCONFIG
-		$SERVICESDIR/$SERVICE $IFACE up
-	fi
-	exit $?
-fi
-
-if [ "$EVENT" == "DISCONNECTED" ]; then
-    # remove network configuration, if needed
-	get_ssid
-	SSID=$RET
-	# configure network, signal DHCP client, etc.
-	# If special networks definition exist, use it
-	if [ -f "$NETWORKDIR/$SSID" ]; then
-		. $NETWORKDIR/$SSID
-		$SERVICESDIR/$SERVICE $IFACE down
-	else
-		IFCONFIG="$NETWORKDIR/AUTO"
-		. $IFCONFIG
-		export IFCONFIG
-		$SERVICESDIR/$SERVICE $IFACE down
-	fi
-	exit $?
-fi

Deleted: trunk/ATTACHMENTS/wpa-service/wpa_service.conf
===================================================================
--- trunk/ATTACHMENTS/wpa-service/wpa_service.conf	2007-08-09 09:39:20 UTC (rev 1079)
+++ trunk/ATTACHMENTS/wpa-service/wpa_service.conf	2007-08-09 09:40:36 UTC (rev 1080)
@@ -1,29 +0,0 @@
- # The wpa_supplicant daemon settings
-
- #the name of the wpa_supplicant client and daemon if they change
-        
-        WPA_CLIENT_NAME="wpa_cli"
-	WPA_DAEMON_NAME="wpa_supplicant"
-	
- # here is the directory where wpa_supplicant.conf should be
-        
-        WPA_CONFIG_DIR="/etc/sysconfig/wpa_supplicant"
- 
- # here is the name of your wpa_supplicant.conf file
-        
-        WPA_CONFIG_FILE="wpa_supplicant.conf"
- 
- # here is the name of your action file
- 	
- 	WPA_ACTION_FILE=$WPA_CONFIG_DIR/wpa_actions
- 
- # This is what need wpa_supplicant
-	
-	WPA_PID_FILE=/var/run/wpa_supplicant.pid
-	WPA_GLOBAL_FILE=/var/run/wpa_supplicant-global
-	WPA_ACCESS_DIR=/var/run/wpa_supplicant
-
- # The service and network directories:
- # SERVICESDIR is LFS/BLFS specific
-	NETWORKDIR=/etc/sysconfig/network.d
-	SERVICESDIR=/etc/sysconfig/network-devices/services




More information about the hints mailing list