diff options
author | EUcancER <root@euer.krebsco.de> | 2012-10-05 01:58:45 +0200 |
---|---|---|
committer | EUcancER <root@euer.krebsco.de> | 2012-10-05 01:58:45 +0200 |
commit | a5642834a5b835d09ed2fcf8433ad015a0612e2e (patch) | |
tree | 921b5697f2671066b6d316159a57e3f6ac2f513c | |
parent | 52ca246e655f385d71d0eed60c326666f796fee3 (diff) | |
parent | 462a1a45ec08fd5e5e010d266eb3871386511b84 (diff) |
Merge branch 'master' of github.com:krebscode/painload
-rw-r--r-- | god/twinter/supervisor.d/twinter.conf | 5 | ||||
-rwxr-xr-x | streams/mpdstreams | 17 |
2 files changed, 14 insertions, 8 deletions
diff --git a/god/twinter/supervisor.d/twinter.conf b/god/twinter/supervisor.d/twinter.conf new file mode 100644 index 00000000..5f5c97ea --- /dev/null +++ b/god/twinter/supervisor.d/twinter.conf @@ -0,0 +1,5 @@ +[program:twinter] +command=/bin/sh /krebs/god/twinter/init.sh +directory=/krebs/god/twinter/ +user=nobody +autorestart=true diff --git a/streams/mpdstreams b/streams/mpdstreams index 75d2af13..d9132937 100755 --- a/streams/mpdstreams +++ b/streams/mpdstreams @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # this version cannot tell if a stream is running or just ordinary music import os @@ -7,6 +7,7 @@ from subprocess import Popen, PIPE os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) pidfile = "/tmp/krebs.stream.pid" +host="lounge.mpd.shack" url_file = os.environ.get("STREAM_DB", "stream.db") urls = [] #urls = [ url,f for (url,f) in open(url_file).readline() ] @@ -29,15 +30,15 @@ def streamForUrl(url): return stream def startStream(stream_url): - Popen(["mpc","crossfade","5"], + Popen(["mpc","--host",host,"crossfade","5"], stdout=pipe_silent,stderr=pipe_silent) - Popen(["mpc","repeat","yes"], + Popen(["mpc","--host",host,"repeat","yes"], stdout=pipe_silent,stderr=pipe_silent) - Popen(["mpc","clear"], + Popen(["mpc","--host",host,"clear"], stdout=pipe_silent,stderr=pipe_silent) - Popen(["mpc","load",stream_url], + Popen(["mpc","--host",host,"add",stream_url], stdout=pipe_silent,stderr=pipe_silent).wait() - Popen(["mpc","play"], + Popen(["mpc","--host",host,"play"], stdout=pipe_silent,stderr=pipe_silent) def start(stream): @@ -56,13 +57,13 @@ def stop(): print "!! No Stream running!" else: print "** Stopping `%s`" % ret - Popen(["mpc","stop"], + Popen(["mpc","--host",host,"stop"], stdout=pipe_silent,stderr=pipe_silent) def running(): try: - (out,err) = Popen(["mpc","current"],stdout=PIPE,stderr=PIPE).communicate() + (out,err) = Popen(["mpc","--host",host,"current"],stdout=PIPE,stderr=PIPE).communicate() out = out.rstrip() return out except Exception as e: |