self.m3u_dir = '/var/www/m3u'
self.log_dir = '/var/log/telecaster'
self.conf_dir = '/etc/telecaster'
- self.stream_m_conf_dir = '/etc/stream-m'
- self.init_dirs = ['/etc/init.d/', '/etc/default/']
- self.daemons = ['jackd', 'telecaster', 'stream-m']
- #self.apache_conf = '/etc/apache2/sites-available/telecaster.conf'
+
def create_user(self):
if not os.path.exists(self.home):
os.system('chown -R ' + self.user + ':' + self.user + ' ' + dir)
def install_deps(self):
- os.system("""sudo aptitude install python python-dev python-xml python-libxml2 python-pip \
- python-setuptools python-twitter python-liblo python-mutagen \
- icecast2 nginx uwsgi jackd libjack-dev vorbis-tools procps meterbridge fluxbox \
- vnc4server vncviewer swh-plugins jack-rack libshout3 libshout3-dev libmad0-dev libogg-dev \
- g++ python-yaml swatch""")
+ package_list = open("debian-requirements.txt", "r").read()
+ os.system("apt install " + package_list)
# Install DeeFuzzer
os.system("pip install deefuzzer")
- # Install Stream-m
- os.chdir(self.app_dir)
- os.system('cp -ra lib/stream-m /usr/local/lib/')
- init_link = '/usr/local/bin/stream-m'
- if not os.path.islink(init_link):
- os.system('ln -s /usr/local/lib/stream-m/bin/stream-m '+init_link)
-
def install_conf(self):
os.chdir(self.app_dir)
- for conf_dir in [self.conf_dir, self.stream_m_conf_dir]:
- in_files = os.listdir('src'+conf_dir)
- os.system('cp -ra src'+ conf_dir + '/*' + ' ' + conf_dir)
+ os.system('cp -ra ' + conf_dir + '/*' + ' ' + conf_dir)
self.chown(conf_dir)
- for dir in os.listdir('src/home'):
+ for dir in os.listdir('env'):
home_dir = self.home + dir
if not os.path.exists(home_dir):
os.makedirs(home_dir)
os.system('cp -r src/home/'+dir + '/* ' + home_dir)
self.chown(home_dir)
- #shutil.copy('src'+self.apache_conf, self.apache_conf)
- os.system('a2ensite telecaster.conf')
- #os.system('/etc/init.d/apache2 reload')
-
- dir = '/etc/pm/'
- os.system('cp -r src' + dir + '* ' + dir)
def install_init(self):
os.chdir(self.app_dir)
- dirs = [self.rss_dir, self.m3u_dir, self.log_dir, self.conf_dir, self.stream_m_conf_dir]
+ dirs = [self.rss_dir, self.m3u_dir, self.log_dir, self.conf_dir]
for dir in dirs:
if not os.path.exists(dir):
os.makedirs(dir)
shutil.copy('src'+path, path)
os.system('sudo chmod 755 '+path)
- os.system('cp -ra src/usr/* /usr/')
- os.system('cp -ra src/etc/init.d/* /etc/init.d/')
+ os.system('cp -ra etc/init.d/* /etc/init.d/')
- os.system('sudo update-rc.d -f jackd remove')
- os.system('sudo update-rc.d -f stream-m remove')
- os.system('sudo update-rc.d -f vncserver remove')
os.system('sudo update-rc.d -f telecaster remove')
- os.system('update-rc.d jackd defaults 30 30')
- os.system('update-rc.d stream-m defaults 20 20')
os.system('update-rc.d telecaster defaults 99 15')
os.system('chmod 777 ' + self.m3u_dir)