]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
arpwatch: Add status command to the initscript
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Sep 2025 13:08:26 +0000 (14:08 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 Sep 2025 13:08:26 +0000 (14:08 +0100)
This is not very reliable as the exit codes are not very clean, but it
is good enough to tell the user on the terminal whether arpwatch is
running and it will fix the web UI output.

Fixes: #13874 - Arpwatch does not display correct status on service.cgi
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/packages/arpwatch

index 09dcdf1ba7b7c469fc1598d7ee479fd3493d8968..316cf3e71c8d11a1e941555a7b2d63baab735275 100644 (file)
@@ -74,6 +74,17 @@ case "${1}" in
                ${0} start
                ;;
 
+       status)
+               failed=0
+
+               for intf in ${INTERFACES}; do
+                       PIDFILE="/var/run/arpwatch-${intf}.pid" \
+                               statusproc /usr/sbin/arpwatch || failed=$?
+               done
+
+               exit ${failed}
+               ;;
+
        *)
                echo "Usage: ${0} {start|stop|restart}"
                exit 1