summaryrefslogtreecommitdiff
path: root/net-misc/crossbar/files/initd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/crossbar/files/initd
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/crossbar/files/initd')
-rw-r--r--net-misc/crossbar/files/initd35
1 files changed, 35 insertions, 0 deletions
diff --git a/net-misc/crossbar/files/initd b/net-misc/crossbar/files/initd
new file mode 100644
index 000000000000..565dfb304aea
--- /dev/null
+++ b/net-misc/crossbar/files/initd
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+NODE=${RC_SVCNAME:9}
+
+command=/usr/bin/crossbar
+command_args="start --cbdir=${BASEDIR}/${NODE} --logtofile --colour=false --loglevel=${LOGLEVEL}"
+command_background=true
+description="start crossbar wamp router for ${NODE}"
+pidfile="${BASEDIR}/${NODE}/crossbar.pid"
+
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ -z "${BASEDIR}" ]; then
+ eerror "BASEDIR not set"
+ return 1
+ fi
+ if [ -z "${USERNAME}" ]; then
+ eerror "USERNAME not set"
+ return 1
+ fi
+ if [ ! -d "${BASEDIR}" ]; then
+ eerror "${BASEDIR} is not a directory"
+ return 1
+ fi
+ if [ ! -e "${BASEDIR}/${NODE}" ]; then
+ eerror "${BASEDIR} does not contain a ${NODE} sub directory"
+ return 1
+ fi
+}