-make sure to autogenerate liquidsoap.cfg before liquidsoap starts
This commit is contained in:
parent
effd28bad1
commit
d8ae8002d2
5 changed files with 66 additions and 8 deletions
|
@ -1,4 +1,6 @@
|
|||
import os
|
||||
import grp
|
||||
import stat
|
||||
import shutil
|
||||
import sys
|
||||
import subprocess
|
||||
|
@ -42,7 +44,15 @@ try:
|
|||
|
||||
if not os.path.exists(PATH_INI_FILE):
|
||||
shutil.copy('%s/../pypo.cfg'%current_script_dir, PATH_INI_FILE)
|
||||
|
||||
|
||||
try:
|
||||
os.remove("/etc/airtime/liquidsoap.cfg")
|
||||
except Exception, e:
|
||||
pass
|
||||
gid = grp.getgrnam("pypo").gr_gid
|
||||
os.chown("/etc/airtime", -1, gid)
|
||||
os.chmod("/etc/airtime", stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
|
|
|
@ -109,17 +109,19 @@ try:
|
|||
print e
|
||||
sys.exit(1)
|
||||
|
||||
"""
|
||||
logging.basicConfig(format='%(message)s')
|
||||
|
||||
#generate liquidsoap config file
|
||||
#access the DB and generate liquidsoap.cfg under /etc/airtime/
|
||||
ac = api_client.api_client_factory(config, logging.getLogger())
|
||||
ss = ac.get_stream_setting()
|
||||
|
||||
|
||||
if ss is not None:
|
||||
generate_liquidsoap_config(ss)
|
||||
else:
|
||||
print "Unable to connect to the Airtime server."
|
||||
"""
|
||||
|
||||
#initialize init.d scripts
|
||||
subprocess.call("update-rc.d airtime-playout defaults >/dev/null 2>&1", shell=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue