Check for liquidsoap on PATH

This commit is contained in:
Lucas Bickel 2017-04-09 11:46:49 +02:00
parent a4244595e5
commit 37bfe34b9e
1 changed files with 8 additions and 10 deletions

View File

@ -30,16 +30,14 @@ def printUsage():
def find_liquidsoap_binary(): def find_liquidsoap_binary():
""" """
With libretime 3.0 we are no longer depending upon airtime-liquidsoap but using the built in liquidsoap With libretime 3.0 we are no longer depending upon the airtime-liquidsoap binary
rather than a bundled version of it. So this function no longer needs to be used. but use a generic install of liquidsoap. This takes care of checking if it is on the
Starting with Airtime 2.0, we don't know the exact location of the Liquidsoap path and will lead to an error otherwise.
binary because it may have been installed through a debian package. Let's find
the location of this binary.
""" """
rv = subprocess.call("which airtime-liquidsoap > /dev/null", shell=True) rv = subprocess.call("which liquidsoap > /dev/null", shell=True)
if rv == 0: if rv == 0:
return "airtime-liquidsoap" return "liquidsoap"
return None return None
@ -97,10 +95,10 @@ try:
raise Exception("Liquidsoap not found!") raise Exception("Liquidsoap not found!")
if stream_type == "icecast": if stream_type == "icecast":
command = "liquidsoap 'output.icecast(%%vorbis, host = \"%s\", port = %s, user= \"%s\", password = \"%s\", mount=\"%s\", sine())'" % (host, port, user, password, mount) command = "%s 'output.icecast(%%vorbis, host = \"%s\", port = %s, user= \"%s\", password = \"%s\", mount=\"%s\", sine())'" % (liquidsoap_exe, host, port, user, password, mount)
else: else:
command = "liquidsoap 'output.shoutcast(%%mp3, host=\"%s\", port = %s, user= \"%s\", password = \"%s\", sine())'" \ command = "%s 'output.shoutcast(%%mp3, host=\"%s\", port = %s, user= \"%s\", password = \"%s\", sine())'" \
% (host, port, user, password) % (liquidsoap_exe, host, port, user, password)
if not verbose: if not verbose:
command += " 2>/dev/null | grep \"failed\"" command += " 2>/dev/null | grep \"failed\""