[crux-commits] ports/core (3.6): dhcpcd: add rc script

crux at crux.nu crux at crux.nu
Sat Jul 4 13:14:39 UTC 2020


commit 2aa4e8d37367abbaf2a26fc021c0657708983cb2
Author: Juergen Daubert <jue at jue.li>
Date:   Sat Jul 4 14:55:03 2020 +0200

    dhcpcd: add rc script

diff --git a/dhcpcd/.footprint b/dhcpcd/.footprint
index 39ee81bc..e172bca4 100644
--- a/dhcpcd/.footprint
+++ b/dhcpcd/.footprint
@@ -1,6 +1,8 @@
 drwxr-xr-x	root/root	etc/
 drwxr-xr-x	root/root	etc/dhcpcd/
 -rw-r--r--	root/root	etc/dhcpcd/dhcpcd.conf
+drwxr-xr-x	root/root	etc/rc.d/
+-rwxr-xr-x	root/root	etc/rc.d/dhcpcd
 drwxr-xr-x	root/root	lib/
 drwxr-xr-x	root/root	lib/dhcpcd/
 drwxr-xr-x	root/root	lib/dhcpcd/dev/
diff --git a/dhcpcd/.signature b/dhcpcd/.signature
index e3437293..c3e0f201 100644
--- a/dhcpcd/.signature
+++ b/dhcpcd/.signature
@@ -1,5 +1,6 @@
 untrusted comment: verify with /etc/ports/core.pub
-RWRJc1FUaeVeqvNlpzZaMVUtKc2Vk+q5RPf9U3AkIYfWt33fhXA7FaDU1NVwgSzsok9ZIgCCLmLsVkUVUprlS6WrXIx8ydgO6ww=
-SHA256 (Pkgfile) = 5cb189485f1f02efa48aedbf7b8270d388bfedd59c37876e1af0609ca29ae53f
-SHA256 (.footprint) = 36408a5de30857e3c77ae409c68ff83d874a30ee33a8d70d75a4280de32743f9
+RWRJc1FUaeVeqisZ6fakCDlTIHCBkZENIdfGJP88DuG6RYgnU50bLOksN4ikwaIsvYVqW0syCrJHgg/qODSg+NFWOHpSVtEJXgU=
+SHA256 (Pkgfile) = fc4eee812706fe0620a713cf356d4f657032f44fd567939e27b6472e921c7522
+SHA256 (.footprint) = 60d0a7b5ba09f8ab2c617616f70daf25c50bcce9603dbbc43c70f788c982b9fb
 SHA256 (dhcpcd-9.1.4.tar.xz) = 5fe133e5497d8af6d26bd6e6b8dd48ab12d124d6cc4cefe6de6536ff97f76820
+SHA256 (rc.dhcpcd) = d12486e28685c1b5a2bce0220b73e4f2bdb1934d1411aa80f55d1448dbc17295
diff --git a/dhcpcd/Pkgfile b/dhcpcd/Pkgfile
index 30b890e2..7551dc70 100644
--- a/dhcpcd/Pkgfile
+++ b/dhcpcd/Pkgfile
@@ -5,8 +5,9 @@
 
 name=dhcpcd
 version=9.1.4
-release=1
-source=(https://roy.marples.name/downloads/dhcpcd/$name-$version.tar.xz)
+release=2
+source=(https://roy.marples.name/downloads/dhcpcd/$name-$version.tar.xz
+        rc.dhcpcd)
 
 build () {
     cd $name-$version
@@ -22,6 +23,7 @@ build () {
     make DESTDIR=$PKG install
 
     install -d -o dhcpcd -g dhcpcd $PKG/var/lib/dhcpcd
+    install -D -m 0755 $SRC/rc.dhcpcd $PKG/etc/rc.d/dhcpcd
 
     chmod -R u+w $PKG
 }
diff --git a/dhcpcd/rc.dhcpcd b/dhcpcd/rc.dhcpcd
new file mode 100755
index 00000000..444c3a12
--- /dev/null
+++ b/dhcpcd/rc.dhcpcd
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# /etc/rc.d/dhcpcd: start/stop dhcp client daemon
+#
+
+SSD=/sbin/start-stop-daemon
+PROG=/sbin/dhcpcd
+PID=/var/run/dhcpcd/pid
+OPTS=""
+
+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