aboutsummaryrefslogtreecommitdiff
path: root/[email protected]
diff options
context:
space:
mode:
-rw-r--r--[email protected]22
1 files changed, 22 insertions, 0 deletions
diff --git a/[email protected] b/[email protected]
new file mode 100644
index 0000000..567a782
--- /dev/null
+++ b/[email protected]
@@ -0,0 +1,22 @@
+[Unit]
+Description=Librespot instance for %I
+After=network.target
+
+[Service]
+Type=simple
+
+# Create the pipe and cache folders automatically
+ExecStartPre=/usr/bin/mkdir -p /opt/spotify-bot/pipes
+ExecStartPre=/usr/bin/mkdir -p /var/cache/librespot/%I
+ExecStartPre=/usr/bin/rm -f /opt/spotify-bot/pipes/%I_pipe
+ExecStartPre=/usr/bin/mkfifo /opt/spotify-bot/pipes/%I_pipe
+
+# Launch Librespot using OAuth and saving credentials to a local cache folder
+ExecStart=/usr/bin/librespot -n "Server Speaker (%I)" --backend pipe --device /opt/spotify-bot/pipes/%I_pipe --cache /var/cache/librespot/%I --enable-oauth
+
+Restart=always
+RestartSec=10
+
+[Install]
+WantedBy=multi-user.target
+