mirror of
https://github.com/openwrt/routing.git
synced 2025-12-22 01:44:32 +04:00
oonf-olsrd2: add support to check if service is running
Signed-off-by: Maciej Krüger <mkg20001@gmail.com>
(cherry picked from commit 618e80a06a)
This commit is contained in:
committed by
Josef Schlehofer
parent
1b720129f7
commit
ff834a87c0
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user