]> apps.delaporte.us Git - matrix-cadbury.git/commitdiff
Add systemd service
authorEdward Delaporte <edward@delaporte.us>
Tue, 7 Apr 2026 03:46:36 +0000 (22:46 -0500)
committerEdward Delaporte <edward@delaporte.us>
Tue, 7 Apr 2026 03:46:36 +0000 (22:46 -0500)
service/cadbury.service [new file with mode: 0755]
service/install.sh [new file with mode: 0755]
service/run.sh [new file with mode: 0755]

diff --git a/service/cadbury.service b/service/cadbury.service
new file mode 100755 (executable)
index 0000000..4d2a7f1
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Cadbury Personal Organizer Matrix Bot
+
+[Service]
+ExecStart=/etc/matrix-cadbury/run.sh
+Type=exec
+EnvironmentFile=/etc/matrix-cadbuary/.env
+
+[Install]
+WantedBy=multi-user.target
diff --git a/service/install.sh b/service/install.sh
new file mode 100755 (executable)
index 0000000..e0ea69e
--- /dev/null
@@ -0,0 +1,18 @@
+# Installs at system level for autostart
+# Requires sudo
+# Pass the path to an appropriate .env as $1
+
+cp $1 /etc/matrix-cadbury/.env
+cd /etc; git clone https://codeberg.org/EdTheDev/matrix-cadbury.git
+
+ADD_SRV=cadbury.service
+DEST=/etc/systemd/system
+
+mkdir -p $DEST
+rm -f $DEST/$ADD_SRV
+cp ../files/autostart/$ADD_SRV $DEST/
+ls -al $DEST | grep $ADD_SRV
+
+systemctl daemon-reload
+systemctl enable $ADD_SRV
+systemctl status $ADD_SRV
diff --git a/service/run.sh b/service/run.sh
new file mode 100755 (executable)
index 0000000..1cd047f
--- /dev/null
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+source /etc/matrix-cadbury/.env
+cd /etc/matrix-cadbury;make