Browse Source

Add systemd unit file for ARDOPc

Convenient for users that want to easily start/stop ARDOPc, or have it
start automatically on boot.
Martin Hebnes Pedersen 1 year ago
parent
commit
5198138574
2 changed files with 21 additions and 0 deletions
  1. 11 0
      share/ardopc/ardop@.service
  2. 10 0
      share/ardopc/install-systemd-ardop-unit.bash

+ 11 - 0
share/ardopc/ardop@.service

@@ -0,0 +1,11 @@
+[Unit]
+Description=ardopc - ARDOP softmodem for %i
+After=network.target sound.target
+
+[Service]
+User=%i
+ExecStart=/bin/sh -c "cd /tmp && /usr/local/bin/ardopc"
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target

+ 10 - 0
share/ardopc/install-systemd-ardop-unit.bash

@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+set -e
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+[ -e "/etc/systemd/system/ardop@.service" ] && rm /etc/systemd/system/ardop@.service
+cp "$DIR/ardop@.service" "/lib/systemd/system/ardop@.service"
+systemctl daemon-reload
+
+echo "Installed. Install (pi)ardopc as /usr/local/bin/ardopc and start it with 'systemctl start ardop@username'"