summaryrefslogtreecommitdiff
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJuergen Daubert <jue@jue.li>2015-09-21 11:58:17 +0200
committerJuergen Daubert <jue@jue.li>2015-09-21 11:58:17 +0200
commit8fab25309d2d3b1b86dec3a353629a1ea53df10f (patch)
treee1faf6b20e6761a55e69b57cae31282c8ea56479 /wpa_supplicant
parentf9050bf43dce1449e1b318d80217dd35691e65b2 (diff)
downloadopt-8fab25309d2d3b1b86dec3a353629a1ea53df10f.tar.gz
opt-8fab25309d2d3b1b86dec3a353629a1ea53df10f.tar.xz
wpa_supplicant: add script to start wpa_supplicant together with dhcpcd (FS#1209)
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/.footprint2
-rw-r--r--wpa_supplicant/.md5sum1
-rw-r--r--wpa_supplicant/Pkgfile8
-rw-r--r--wpa_supplicant/wlan52
4 files changed, 61 insertions, 2 deletions
diff --git a/wpa_supplicant/.footprint b/wpa_supplicant/.footprint
index 58bdf26db..4e2d821d2 100644
--- a/wpa_supplicant/.footprint
+++ b/wpa_supplicant/.footprint
@@ -1,4 +1,6 @@
drwxr-xr-x root/root etc/
+drwxr-xr-x root/root etc/rc.d/
+-rwxr-xr-x root/root etc/rc.d/wlan
lrwxrwxrwx root/root etc/wpa.conf -> wpa_supplicant.conf
-rw------- root/root etc/wpa_supplicant.conf
drwxr-xr-x root/root usr/
diff --git a/wpa_supplicant/.md5sum b/wpa_supplicant/.md5sum
index ae17477d8..6d4a7a870 100644
--- a/wpa_supplicant/.md5sum
+++ b/wpa_supplicant/.md5sum
@@ -1 +1,2 @@
+3295bcafa5f4c7fb46dbfcece4f2f0a6 wlan
f0037dbe03897dcaf2ad2722e659095d wpa_supplicant-2.4.tar.gz
diff --git a/wpa_supplicant/Pkgfile b/wpa_supplicant/Pkgfile
index 613951810..c215d07b0 100644
--- a/wpa_supplicant/Pkgfile
+++ b/wpa_supplicant/Pkgfile
@@ -5,8 +5,9 @@
name=wpa_supplicant
version=2.4
-release=1
-source=(http://hostap.epitest.fi/releases/$name-$version.tar.gz)
+release=2
+source=(http://hostap.epitest.fi/releases/$name-$version.tar.gz
+ wlan)
build () {
cd $name-$version/$name
@@ -28,4 +29,7 @@ build () {
# symlink for compatibility with older releases
ln -s wpa_supplicant.conf $PKG/etc/wpa.conf
+
+ # rc script
+ install -D -m 0755 $SRC/wlan $PKG/etc/rc.d/wlan
}
diff --git a/wpa_supplicant/wlan b/wpa_supplicant/wlan
new file mode 100644
index 000000000..666d30c84
--- /dev/null
+++ b/wpa_supplicant/wlan
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# /etc/rc.d/wlan: start/stop wireless interface
+#
+
+DEV=wlp3s0
+
+
+SSD=/sbin/start-stop-daemon
+PROG_DHCP=/sbin/dhcpcd
+PROG_WIFI=/usr/sbin/wpa_supplicant
+PID_DHCP=/var/run/dhcpcd.pid
+PID_WIFI=/var/run/wpa_supplicant.pid
+
+OPTS_DHCP="--waitip -h $(/bin/hostname) -z $DEV"
+OPTS_WIFI="-B -P $PID_WIFI -D nl80211,wext -c /etc/wpa_supplicant.conf -i $DEV"
+
+
+print_status() {
+ $SSD --status --pidfile $2
+ case $? in
+ 0) echo "$1 is running with pid $(cat $2)" ;;
+ 1) echo "$1 is not running but the pid file $2 exists" ;;
+ 3) echo "$1 is not running" ;;
+ 4) echo "Unable to determine the program status" ;;
+ esac
+}
+
+case $1 in
+ start)
+ $SSD --start --pidfile $PID_WIFI --exec $PROG_WIFI -- $OPTS_WIFI
+ $SSD --start --pidfile $PID_DHCP --exec $PROG_DHCP -- $OPTS_DHCP
+ ;;
+ stop)
+ $SSD --stop --retry 10 --pidfile $PID_DHCP
+ $SSD --stop --retry 10 --pidfile $PID_WIFI
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ print_status $PROG_WIFI $PID_WIFI
+ print_status $PROG_DHCP $PID_DHCP
+ ;;
+ *)
+ echo "Usage: $0 [start|stop|restart|status]"
+ ;;
+esac
+
+# End of file
+

Generated by cgit