summaryrefslogtreecommitdiffstats
path: root/roles/stream/templates/on-connect
diff options
context:
space:
mode:
Diffstat (limited to 'roles/stream/templates/on-connect')
-rwxr-xr-xroles/stream/templates/on-connect12
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/stream/templates/on-connect b/roles/stream/templates/on-connect
new file mode 100755
index 0000000..0f613bf
--- /dev/null
+++ b/roles/stream/templates/on-connect
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -e
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+PIDFILE="{{ icecast_restream_dir }}/{{ emacsconf_id }}-lowres-{{ item.id }}.pid"
+echo $(date) " on connect {{ item.id }} $*" >> {{ icecast_restream_dir }}/restream.log
+
+. /lib/lsb/init-functions
+
+start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile $PIDFILE \
+ --oknodo \
+ --exec /usr/local/bin/{{ emacsconf_id }}-lowres-{{ item.id }}.sh > /dev/null