[crux-commits] ports/opt (3.6): wpa_supplicant: new rc script wpa_supplicant, rc script wlan reworked

crux at crux.nu crux at crux.nu
Sun Jul 19 09:23:18 UTC 2020


commit c79887e54996b9bd45bd76d88e51bfb578a9bc02
Author: Juergen Daubert <jue at jue.li>
Date:   Sun Jul 19 09:22:49 2020 +0000

    wpa_supplicant: new rc script wpa_supplicant, rc script wlan reworked

diff --git a/wpa_supplicant/.footprint b/wpa_supplicant/.footprint
index c91dc8c4c..5d2cb8167 100644
--- a/wpa_supplicant/.footprint
+++ b/wpa_supplicant/.footprint
@@ -4,6 +4,7 @@ drwxr-xr-x	root/root	etc/dbus-1/system.d/
 -rw-r--r--	root/root	etc/dbus-1/system.d/wpa_supplicant.conf
 drwxr-xr-x	root/root	etc/rc.d/
 -rwxr-xr-x	root/root	etc/rc.d/wlan
+-rwxr-xr-x	root/root	etc/rc.d/wpa_supplicant
 -rw-------	root/root	etc/wpa_supplicant.conf
 drwxr-xr-x	root/root	usr/
 drwxr-xr-x	root/root	usr/sbin/
diff --git a/wpa_supplicant/.signature b/wpa_supplicant/.signature
index 4f4e9d51d..584d83085 100644
--- a/wpa_supplicant/.signature
+++ b/wpa_supplicant/.signature
@@ -1,6 +1,7 @@
 untrusted comment: verify with /etc/ports/opt.pub
-RWSE3ohX2g5d/bBkglfc5Kf7FqO75e8sBRoDxeEu1jE19YyVOSNtu/B1zczVCl2lj+IEzSo7QPQferyOiW2Lq2O+4+x9TVE+aww=
-SHA256 (Pkgfile) = 7a7e255e574e99249c90d88b100fdd6f48e20ab023b6227513e4db0801e91b6b
-SHA256 (.footprint) = d4302c7846d3447459040f032e05e10dc251113e6a1555b045a4d95aded9e409
+RWSE3ohX2g5d/Z8F24R/uGzt+LbODHEqKa+KVfxqZHO3MUmvLqMtLaHfPIf9kBgf11ptZptyHR/sWsOK4dAXyvTeeDfwqHcU8QE=
+SHA256 (Pkgfile) = 508a0c594521cbef1a989d3f230f5d409febc6a11ba0ceefa73a3a76aa58319a
+SHA256 (.footprint) = c601da7d8f0118f98fe747611466a530d48519832c8aba47db01df055d64f869
 SHA256 (wpa_supplicant-2.9.tar.gz) = fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17
-SHA256 (wlan) = 62f4c0bf8d5fedcf5b6ad79278f4be16f29841099f385acc4fc91e2d52ca1927
+SHA256 (wpa_supplicant) = 6d7c37c49d4f06194195ca1e7c66a4bb067d82e3884b278e6cdd72c6f7476bae
+SHA256 (wlan) = c025ad557806d86ef231770c8a77a02a0194d92d89b5fb16bec036eddbc5d308
diff --git a/wpa_supplicant/Pkgfile b/wpa_supplicant/Pkgfile
index 64a555e59..83e2f3b5c 100644
--- a/wpa_supplicant/Pkgfile
+++ b/wpa_supplicant/Pkgfile
@@ -5,9 +5,9 @@
 
 name=wpa_supplicant
 version=2.9
-release=1
+release=2
 source=(https://w1.fi/releases/$name-$version.tar.gz
-        wlan)
+        wpa_supplicant wlan)
 
 build () {
     cd $name-$version/$name
@@ -31,6 +31,7 @@ build () {
 
     # rc script
     install -D -m 0755 $SRC/wlan $PKG/etc/rc.d/wlan
+    install -m 0755 $SRC/wpa_supplicant $PKG/etc/rc.d
 
     # dbus
     install -d $PKG/{usr/share/dbus-1/system-services,etc/dbus-1/system.d}
diff --git a/wpa_supplicant/wlan b/wpa_supplicant/wlan
index 9a2f935c5..b4af6e58b 100644
--- a/wpa_supplicant/wlan
+++ b/wpa_supplicant/wlan
@@ -3,54 +3,26 @@
 # /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
-		RETVAL=$?
+		/etc/rc.d/wpa_supplicant start
+		/etc/rc.d/dhcpcd start
 		;;
 	stop)
-		( $SSD --stop --retry 10 --pidfile $PID_DHCP 
-		  $SSD --stop --retry 10 --pidfile $PID_WIFI )
-		RETVAL=$?
+		/etc/rc.d/dhcpcd stop
+		/etc/rc.d/wpa_supplicant stop
 		;;
 	restart)
-		$0 stop
-		$0 start
+		/etc/rc.d/wpa_supplicant restart
+		/etc/rc.d/dhcpcd restart
 		;;
 	status)
-		print_status $PROG_WIFI $PID_WIFI
-		print_status $PROG_DHCP $PID_DHCP
+		/etc/rc.d/wpa_supplicant status
+		/etc/rc.d/dhcpcd status
 		;;
 	*)
 		echo "Usage: $0 [start|stop|restart|status]"
 		;;
 esac
 
-exit $RETVAL
-
 # End of file
-
diff --git a/wpa_supplicant/wpa_supplicant b/wpa_supplicant/wpa_supplicant
new file mode 100755
index 000000000..4a812d481
--- /dev/null
+++ b/wpa_supplicant/wpa_supplicant
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# /etc/rc.d/wpa_supplicant: start/stop wpa_supplicant
+#
+
+DEV=wlp3s0
+
+SSD=/sbin/start-stop-daemon
+PROG=/usr/sbin/wpa_supplicant
+PID=/var/run/wpa_supplicant.pid
+OPTS="-B -P $PID -D nl80211,wext -c /etc/wpa_supplicant.conf -i $DEV"
+
+
+case $1 in
+	start)
+		$SSD --start --pidfile $PID --exec $PROG -- $OPTS
+		;;
+	stop)
+		$SSD --stop --retry 10 --pidfile $PID
+		;;
+	restart)
+		$0 stop
+		$0 start
+		;;
+	status)
+		$SSD --status --pidfile $PID
+		case $? in
+		0) echo "$PROG is running with pid $(cat $PID)" ;;
+		1) echo "$PROG is not running but the pid file $PID exists" ;;
+		3) echo "$PROG is not running" ;;
+		4) echo "Unable to determine the program status" ;;
+		esac
+		;;
+	*)
+		echo "Usage: $0 [start|stop|restart|status]"
+		;;
+esac
+
+# End of file


More information about the crux-commits mailing list