aboutsummaryrefslogtreecommitdiffstats
path: root/testing/matrix-appservice-irc/matrix-appservice-irc.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/matrix-appservice-irc/matrix-appservice-irc.initd')
-rw-r--r--testing/matrix-appservice-irc/matrix-appservice-irc.initd32
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/matrix-appservice-irc/matrix-appservice-irc.initd b/testing/matrix-appservice-irc/matrix-appservice-irc.initd
new file mode 100644
index 0000000000..2c80daad6b
--- /dev/null
+++ b/testing/matrix-appservice-irc/matrix-appservice-irc.initd
@@ -0,0 +1,32 @@
+#!/sbin/openrc-run
+supervisor=supervise-daemon
+
+name="matrix-appservice-irc"
+description="Daemon for matrix-appservice-irc, a Node.js IRC bridge for Matrix"
+
+: ${command_user:="synapse:synapse"}
+: ${config:="/etc/matrix-appservice-irc/config.yaml"}
+: ${registration_file:="/etc/synapse/matrix-appservice-irc-registration.yaml"}
+: ${port:=9999}
+
+command="/usr/bin/matrix-appservice-irc"
+command_args="-c $config -f $registration_file -p $port"
+supervise_daemon_args="--chdir /var/lib/matrix-appservice-irc --stdout /var/log/matrix-appservice-irc.log --stderr /var/log/matrix-appservice-irc.log"
+
+depends() {
+ use logger
+ need net
+}
+
+start_pre() {
+ checkpath --owner $command_user --file /var/log/matrix-appservice-irc.log
+ if [ ! -f $config ]; then
+ eerror "Couldn't find config file!"
+ return 1
+ fi
+ if [ ! -f $registration_file ]; then
+ eerror "Couldn't find registration file!
+ See https://github.com/matrix-org/matrix-appservice-irc#3-registration for how to generate one."
+ return 1
+ fi
+}