mirror of
https://git.openwrt.org/feed/routing.git
synced 2025-01-05 10:16:40 +08:00
oonf-olsrd2: add support to check if service is running
Signed-off-by: Maciej Krüger <mkg20001@gmail.com>
This commit is contained in:
parent
593a514ab5
commit
618e80a06a
@ -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
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user