git: e2e231d0b5b0 - main - dns/knot-resolver: Fix service status

From: Fernando Apesteguía <fernape_at_FreeBSD.org>
Date: Wed, 12 Oct 2022 12:01:49 UTC
The branch main has been updated by fernape:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e2e231d0b5b03e64e9905b39e76ad9fd89ec765f

commit e2e231d0b5b03e64e9905b39e76ad9fd89ec765f
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2022-10-11 15:49:47 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-10-12 11:58:10 +0000

    dns/knot-resolver: Fix service status
    
    Add status() function to rc script.
    
    PR:             266320
    Reported by:    yonas.yanfa@gmail.com
    Approved by:    freebsd@dns.company (maintainer, timeout > 1 month)
---
 dns/knot-resolver/files/kresd.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dns/knot-resolver/files/kresd.in b/dns/knot-resolver/files/kresd.in
index 344bf82f9479..9cc3d309a43f 100644
--- a/dns/knot-resolver/files/kresd.in
+++ b/dns/knot-resolver/files/kresd.in
@@ -62,4 +62,14 @@ kresd_stop() {
 	fi
 	}
 
+kresd_status() {
+    if [ -e "${pidfile}" ]; then
+        echo "${name} is running on pid $(cat $pidfile)."
+        return 1
+    else
+        echo "${name} is not running."
+        return 0
+    fi
+}
+
 run_rc_command "$1"