summaryrefslogtreecommitdiffstats
path: root/system/cdemu-daemon/config/cdemu-daemon-session.sh
diff options
context:
space:
mode:
Diffstat (limited to 'system/cdemu-daemon/config/cdemu-daemon-session.sh')
-rw-r--r--system/cdemu-daemon/config/cdemu-daemon-session.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/system/cdemu-daemon/config/cdemu-daemon-session.sh b/system/cdemu-daemon/config/cdemu-daemon-session.sh
new file mode 100644
index 0000000000..c533612a73
--- /dev/null
+++ b/system/cdemu-daemon/config/cdemu-daemon-session.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Starts the CDEmu daemon instance on D-Bus *session* bus. Optional
+# configuration (number of devices, audio driver, log file) are read
+# from ~/.cdemu-daemon
+
+# Default settings
+NUM_DEVICES=1
+AUDIO_DRIVER=default
+LOG_FILE=~/.cdemu-daemon.log
+
+# Read the settings
+CONFIG_FILE=~/.cdemu-daemon
+
+if [ -f ${CONFIG_FILE} ]; then
+ . ${CONFIG_FILE};
+fi
+
+# Start the daemon
+exec cdemu-daemon --ctl-device=/dev/vhba_ctl --bus=session --num-devices=${NUM_DEVICES} --audio-driver=${AUDIO_DRIVER} --logfile=${LOG_FILE}