More improvements to the pypo installer:
* Added installation of daemontool scripts * Put files in more appropriate places * Renamed files for consistency
This commit is contained in:
parent
a255fc4508
commit
80b066a4e1
11 changed files with 788 additions and 313 deletions
|
@ -1,57 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import time
|
||||
import os
|
||||
import traceback
|
||||
from optparse import *
|
||||
import sys
|
||||
import time
|
||||
import datetime
|
||||
import logging
|
||||
import logging.config
|
||||
import shutil
|
||||
import string
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
|
||||
def create_path(path):
|
||||
if not (os.path.exists(path)):
|
||||
print "Creating directory " + path
|
||||
os.makedirs(path)
|
||||
|
||||
try:
|
||||
# Does pypo user exist?
|
||||
print "Checking for pypo user..."
|
||||
p = Popen('id pypo', shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||
output = p.stdout.read()
|
||||
if (output[0:3] != "uid"):
|
||||
# Make the pypo user
|
||||
print "Creating pypo user..."
|
||||
os.system("adduser --system --quiet --group --disabled-login --no-create-home pypo")
|
||||
|
||||
print "Creating directories..."
|
||||
create_path("/var/log/pypo")
|
||||
os.system("chmod -R 755 /var/log/pypo")
|
||||
os.system("chown -R pypo:pypo /var/log/pypo")
|
||||
#os.mkdirs("/var/log/liquidsoap")
|
||||
#os.system("chown -R liquidsoap:liquidsoap /var/log/liquidsoap")
|
||||
create_path("/opt/pypo")
|
||||
create_path("/opt/pypo/bin")
|
||||
create_path("/opt/pypo/cache")
|
||||
create_path("/opt/pypo/files")
|
||||
create_path("/opt/pypo/files/basic")
|
||||
create_path("/opt/pypo/files/fallback")
|
||||
create_path("/opt/pypo/files/jingles")
|
||||
create_path("/opt/pypo/archive")
|
||||
os.system("chmod -R 755 /opt/pypo/")
|
||||
os.system("chown -R pypo:pypo /opt/pypo")
|
||||
|
||||
shutil.copy("../pypo/scripts/silence-playlist.lsp", "/opt/pypo/files/basic")
|
||||
shutil.copy("../pypo/scripts/silence.mp3", "/opt/pypo/files/basic")
|
||||
shutil.copy("../pypo/pypo-cli.py", "/opt/pypo/bin")
|
||||
|
||||
except Exception, e:
|
||||
print "exception:" + str(e)
|
||||
|
||||
print "Done."
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue