2020-02-16 22:38:09 +01:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
# Copyright 2020 Gentoo Authors
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
name="fort validator daemon"
|
|
|
|
description="FORT validator is an open source RPKI validator."
|
|
|
|
command=/usr/bin/fort
|
|
|
|
command_args="${FORT_OPTS}"
|
|
|
|
command_user="fort"
|
|
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
|
|
command_background=true
|
2020-02-19 13:23:17 +01:00
|
|
|
retry=25
|
2020-02-16 22:38:09 +01:00
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
2020-02-17 12:59:32 +01:00
|
|
|
if [ -z "${FORT_BASEDIR}" ]; then
|
|
|
|
FORT_BASEDIR=$(awk -F '"' '/local-repository/ { print $4 }' \
|
|
|
|
/etc/fort/config.json)
|
|
|
|
FORT_BASEDIR="${FORT_BASEDIR:-/var/lib/fort/}"
|
|
|
|
fi
|
|
|
|
|
2020-02-16 22:38:09 +01:00
|
|
|
checkpath -d -m 0750 -o fort:fort ${FORT_BASEDIR}
|
2020-02-17 08:43:28 +01:00
|
|
|
|
|
|
|
if [ "${RC_CMD}" = "restart" ] ; then
|
2020-02-19 13:23:17 +01:00
|
|
|
sleep 20
|
2020-02-17 08:43:28 +01:00
|
|
|
fi
|
2020-02-16 22:38:09 +01:00
|
|
|
}
|