From: Edward Delaporte Date: Tue, 7 Apr 2026 03:46:36 +0000 (-0500) Subject: Add systemd service X-Git-Url: https://us-delaporte.pagekite.me/gitweb/matrix-cadbury.git/commitdiff_plain/fe0bd2246fc6cddccd87287fa4d1e88174cfbbbd?hp=86c8257c4a5eda9207122b194073a297804a2495 Add systemd service --- diff --git a/service/cadbury.service b/service/cadbury.service new file mode 100755 index 0000000..4d2a7f1 --- /dev/null +++ b/service/cadbury.service @@ -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 index 0000000..e0ea69e --- /dev/null +++ b/service/install.sh @@ -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 index 0000000..1cd047f --- /dev/null +++ b/service/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +source /etc/matrix-cadbury/.env +cd /etc/matrix-cadbury;make