SOURCES: wpa_supplicant.sysconfig (NEW), wpa_supplicant.init (NEW)...

adamg adamg at pld-linux.org
Wed May 10 12:04:46 CEST 2006


Author: adamg                        Date: Wed May 10 10:04:45 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new

---- Files affected:
SOURCES:
   wpa_supplicant.sysconfig (NONE -> 1.1)  (NEW), wpa_supplicant.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/wpa_supplicant.sysconfig
diff -u /dev/null SOURCES/wpa_supplicant.sysconfig:1.1
--- /dev/null	Wed May 10 12:04:45 2006
+++ SOURCES/wpa_supplicant.sysconfig	Wed May 10 12:04:40 2006
@@ -0,0 +1,9 @@
+# wpa_supplicant config
+#
+# interfaces wpa_supplicant should listen on
+# INTERFACES="wlan0"
+
+# drivers to use
+# possible values: atmel dscape hostap ipw ndiswrapper prism54 wext
+# and optionally madwifi (if compiled with madwifi support)
+# DRIVERS="ndiswrapper prism"

================================================================
Index: SOURCES/wpa_supplicant.init
diff -u /dev/null SOURCES/wpa_supplicant.init:1.1
--- /dev/null	Wed May 10 12:04:45 2006
+++ SOURCES/wpa_supplicant.init	Wed May 10 12:04:40 2006
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# wpa_supplicant	Linux WPA/WPA2/RSN/IEEE 802.1X supplicant
+#
+# chkconfig:		345 12 88
+# description:		wpa_supplicant is a WPA Supplicant for Linux, BSD and \
+#     			Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). \
+#			Supplicant is the IEEE 802.1X/WPA component that is \ 
+#			used in the client stations. It implements key negotiation \
+#			with a WPA Authenticator and it controls the roaming and IEEE \
+#			802.11 authentication/association of the wlan driver.
+#
+# author:		Adam Gołębiowski <adamg at pld-linux.org> 2006
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Source service config
+[ -f /etc/sysconfig/wpa_supplicant ] && . /etc/sysconfig/wpa_supplicant
+
+# check for proper data
+[ "$INTERFACES" != "" ] || exit 0
+[ "$DRIVERS" != "" ] || exit 0
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+        if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+                msg_network_down wpa_supplicant
+                exit 1
+        fi
+else
+        exit 0
+fi
+
+
+start() {
+	# check if service is already running
+	if [ ! -f /var/lock/subsys/wpa_supplicant ]; then
+		msg_starting wpa_supplicant
+		# prepare command line parameters
+		INT="";
+		DRV="";
+		for INTERFACE in $INTERFACES; do
+			INT="$INT -i$INTERFACE";
+		done;
+		for DRIVER in $DRIVERS; do
+			DRV="$DRV -D$DRIVER";
+		done;
+
+		daemon wpa_supplicant -c /etc/wpa_supplicant.conf $INT $DRV -B
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/wpa_supplicant
+		return $RETVAL
+	else
+		msg_already_running wpa_supplicant
+	fi
+}
+
+stop() {
+	# stop daemons
+	if [ -f /var/lock/subsys/wpa_supplicant ]; then
+		msg_stopping wpa_supplicant
+		killproc wpa_supplicant
+		RETVAL=$?
+		[  $RETVAL -eq 0 ] && rm -f /var/lock/subsys/wpa_supplicant
+	else
+		msg_not_running wpa_supplicant
+	fi
+}
+
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+	start|stop|restart)
+  		$1
+		;;
+	*)
+		echo $"Usage: $0 {start|stop|restart}"
+		exit 1
+esac
+
================================================================


More information about the pld-cvs-commit mailing list