mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-08 20:03:58 +01:00
Create service script for open-rc (#711)
This commit is contained in:
parent
8b55caa15e
commit
df78158cfa
35
examples/service_scripts/nebula.open-rc
Normal file
35
examples/service_scripts/nebula.open-rc
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
#
|
||||||
|
# nebula service for open-rc systems
|
||||||
|
|
||||||
|
extra_commands="checkconfig"
|
||||||
|
|
||||||
|
: ${NEBULA_CONFDIR:=${RC_PREFIX%/}/etc/nebula}
|
||||||
|
: ${NEBULA_CONFIG:=${NEBULA_CONFDIR}/config.yml}
|
||||||
|
: ${NEBULA_BINARY:=${NEBULA_BINARY}${RC_PREFIX%/}/usr/local/sbin/nebula}
|
||||||
|
|
||||||
|
command="${NEBULA_BINARY}"
|
||||||
|
command_args="${NEBULA_OPTS} -config ${NEBULA_CONFIG}"
|
||||||
|
|
||||||
|
supervisor="supervise-daemon"
|
||||||
|
|
||||||
|
description="A scalable overlay networking tool with a focus on performance, simplicity and security"
|
||||||
|
|
||||||
|
required_dirs="${NEBULA_CONFDIR}"
|
||||||
|
required_files="${NEBULA_CONFIG}"
|
||||||
|
|
||||||
|
checkconfig() {
|
||||||
|
"${command}" -test ${command_args} || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
if [ "${RC_CMD}" != "restart" ] ; then
|
||||||
|
checkconfig || return $?
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_pre() {
|
||||||
|
if [ "${RC_CMD}" = "restart" ] ; then
|
||||||
|
checkconfig || return $?
|
||||||
|
fi
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user