wok-6.x rev 938
wpa_supplicant: run as daemon
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jun 23 16:53:33 2008 +0000 (2008-06-23) |
parents | 72fa50265748 |
children | d086e9fbb545 |
files | wpa_supplicant/receipt wpa_supplicant/stuff/etc/init.d/wpa_supplicant wpa_supplicant/stuff/etc/init.d/wpa_supplicant.sh |
line diff
1.1 --- a/wpa_supplicant/receipt Mon Jun 23 15:15:07 2008 +0000 1.2 +++ b/wpa_supplicant/receipt Mon Jun 23 16:53:33 2008 +0000 1.3 @@ -5,7 +5,7 @@ 1.4 CATEGORY="utilities" 1.5 SHORT_DESC="WPA Supplicant with support for WPA and WPA2" 1.6 MAINTAINER="0dddba11@googlemail.com" 1.7 -DEPENDS="" 1.8 +DEPENDS="openssl" 1.9 BUILD_DEPENDS="openssl-dev" 1.10 TARBALL="$PACKAGE-$VERSION.tar.gz" 1.11 WEB_SITE="http://hostap.epitest.fi/wpa_supplicant/" 1.12 @@ -32,3 +32,12 @@ 1.13 cp -a stuff/etc $fs 1.14 } 1.15 1.16 +# Pre and post install commands for Tazpkg. 1.17 +post_install() 1.18 +{ 1.19 + grep -q ^WPA_CONF= $1/etc/daemon.conf || cat >> $1/etc/daemon.conf <<EOT 1.20 +# wpa_supplicant daemon options 1.21 +WPA_CONF="-Bw -P/var/run/wpa_supplicant.pid -c/etc/wpa_supplicant.conf -iwlan0" 1.22 + 1.23 +EOT 1.24 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/wpa_supplicant/stuff/etc/init.d/wpa_supplicant Mon Jun 23 16:53:33 2008 +0000 2.3 @@ -0,0 +1,55 @@ 2.4 +#!/bin/sh 2.5 +# /etc/init.d/wpa_supplicant: Start, stop and restart wpa_supplicant deamon 2.6 +# on SliTaz, at boot time or with the command line. 2.7 +# 2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 2.10 +# 2.11 +. /etc/init.d/rc.functions 2.12 +. /etc/daemons.conf 2.13 + 2.14 +NAME=wpa_supplicant 2.15 +DESC="wpa_supplicant deamon" 2.16 +DAEMON=/usr/sbin/wpa_supplicant 2.17 +OPTIONS=$WPA_OPTIONS 2.18 +PIDFILE=/var/run/wpa_supplicant.pid 2.19 + 2.20 +case "$1" in 2.21 + start) 2.22 + if [ -f $PIDFILE ] ; then 2.23 + echo "$NAME already running." 2.24 + exit 1 2.25 + fi 2.26 + echo -n "Starting $DESC: $NAME... " 2.27 + $DAEMON $OPTIONS 2.28 + status 2.29 + ;; 2.30 + stop) 2.31 + if [ ! -f $PIDFILE ] ; then 2.32 + echo "$NAME is not running." 2.33 + exit 1 2.34 + fi 2.35 + echo -n "Stopping $DESC: $NAME... " 2.36 + kill `cat $PIDFILE` 2.37 + status 2.38 + ;; 2.39 + restart) 2.40 + if [ ! -f $PIDFILE ] ; then 2.41 + echo "$NAME is not running." 2.42 + exit 1 2.43 + fi 2.44 + echo -n "Restarting $DESC: $NAME... " 2.45 + kill `cat $PIDFILE` 2.46 + sleep 2 2.47 + $DAEMON $OPTIONS 2.48 + status 2.49 + ;; 2.50 + *) 2.51 + echo "" 2.52 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 2.53 + echo "" 2.54 + exit 1 2.55 + ;; 2.56 +esac 2.57 + 2.58 +exit 0
3.1 --- a/wpa_supplicant/stuff/etc/init.d/wpa_supplicant.sh Mon Jun 23 15:15:07 2008 +0000 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,10 +0,0 @@ 3.4 -#!/bin/sh 3.5 -# /etc/init.d/wpa_supplicant.sh - WPA initialisation boot script. 3.6 -# Config file is: /etc/wpa_supplicant.conf 3.7 -# 3.8 -. /etc/init.d/rc.functions 3.9 -. /etc/network.conf 3.10 - 3.11 -# Start wpa_supplicant 3.12 -echo "Starting WPA on $INTERFACE... " 3.13 -/usr/bin/wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -iwlan0