aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralarig <alarig@swordarmor.fr>2020-03-13 12:06:48 +0100
committeralarig <alarig@swordarmor.fr>2020-03-13 13:16:00 +0100
commit306074bb6b298fbf0a3988372f7f10795b973faf (patch)
treea15b712fe0fe0f3ddf06a5987051c844b10dbe70 /net-misc/FORT-validator/files/fort-initd
parentdev-python/black: EAPI bump (diff)
downloadguru-306074bb6b298fbf0a3988372f7f10795b973faf.tar.gz
guru-306074bb6b298fbf0a3988372f7f10795b973faf.tar.bz2
guru-306074bb6b298fbf0a3988372f7f10795b973faf.zip
net-misc/FORT-validator: RPKI validator (new ebuild)
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
Diffstat (limited to 'net-misc/FORT-validator/files/fort-initd')
-rw-r--r--net-misc/FORT-validator/files/fort-initd26
1 files changed, 26 insertions, 0 deletions
diff --git a/net-misc/FORT-validator/files/fort-initd b/net-misc/FORT-validator/files/fort-initd
new file mode 100644
index 00000000..25e6b309
--- /dev/null
+++ b/net-misc/FORT-validator/files/fort-initd
@@ -0,0 +1,26 @@
+#!/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
+
+depend() {
+ need net
+}
+
+start_pre() {
+ if [ -z "${FORT_BASEDIR}" ]; then
+ FORT_BASEDIR=$(awk -F '"' '/local-repository/ { print $4 }' \
+ /etc/fort/config.json)
+ FORT_BASEDIR="${FORT_BASEDIR:-/var/cache/fort/repository/}"
+ fi
+
+ checkpath -d -m 0755 -o fort:fort "$(dirname "${FORT_BASEDIR}")"
+ checkpath -d -m 0755 -o fort:fort "${FORT_BASEDIR}"
+}