Skip to content
Snippets Groups Projects
Commit ff834a87 authored by Maciej Krüger's avatar Maciej Krüger Committed by Josef Schlehofer
Browse files

oonf-olsrd2: add support to check if service is running


Signed-off-by: default avatarMaciej Krüger <mkg20001@gmail.com>
(cherry picked from commit 618e80a06a6c032d09bc9cfa333fde893ec9f8d1)
parent 1b720129
No related branches found
No related tags found
1 merge request!27Uplift routing to OpenWRT 23.05.0-rc3
......@@ -118,3 +118,20 @@ reload()
oonf_add_devices_to_configuration
oonf_reread_config
}
running()
{
# check if we have a pidfile and then check if that pid still exists.
# since we don't use -e this has to be explicitly returned. exit would stop the process.
test -e "/tmp/run/olsrd2.pid" && test -e "/proc/$(cat "/tmp/run/olsrd2.pid")" && return 0
return 1
}
status()
{
if running; then
echo "running"
else
echo "stopped"
fi
}
include $(TOPDIR)/rules.mk
PKG_NAME:=oonf-olsrd2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
......
......@@ -5,4 +5,7 @@ DAEMON='olsrd2'
[ -n "$IPKG_INSTROOT" ] || {
. /lib/functions/oonf_init.sh
extra_command "running" "Check if service is running"
extra_command "status" "Service status"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment