Criando instalador de shoutcast e auto-DJ [RESOLVIDO]

1. Criando instalador de shoutcast e auto-DJ [RESOLVIDO]

dfn
IDFNI

(usa Debian)

Enviado em 14/11/2011 - 10:40h

Estava procurando um script que pudesse instalar e executar o shoutcast e o autodj, bom não achei nenhum então optei por criar um:
testei em dois distritos, Debian e ubuntu (derivado do Debian), então acredito que não haverá problemas em outra distribuição derivado do Debian:

Importante modificar apenas as variáveis!!!
Ele vai criar tudo, playlist, arquivos de configuração e pastas raiz (cd /radio/)
log do shoutcast: tail -f /radio/shoutcast.log
log do autodj: tail -f /radio/dj.log
Em caso de ideias estou a disposição, futuramente vou integrar tudo para o php, mas isso já é outro assunto
Email para contato:dfnmaster@hotmail.com


#################### variáveis #####################
##############criador de playlist###################
pasta=/* #colocar a pasta da MP3
##############configuracao server###################
pass=1234 # senha para dj
apass=12345 # Senha para acesso HTTP
##############configuração autodj###################
qualidade=98000 # qualiade da radio em bitrate
radio=nome da radio # nome da sua radio
url=http://seusite.com # seu site
genero=genero # Genero da sua radio
user=admin # user do testUI
passUI=admin # senha do testUI
####################################################
############## final variáveis #####################
####################################################
####################################################
###### NAO MODIFICAR O SCRIPT A PARTIR DAKI!! ######
####################################################
####################################################
echo -----install shoutcast-----##
mkdir /radio/
mkdir /radio/server/
mkdir /radio/dj/
cd /radio/server/
wget http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_07_31_2011.tar.gz
tar -zxvf sc_serv2_linux_07_31_2011.tar.gz
echo logfile=logs/sc_serv.log >> sc_serv.conf
echo w3clog=logs/sc_w3c.log >> sc_serv.conf
echo banfile=control/sc_serv.ban >> sc_serv.conf
echo ripfile=control/sc_serv.rip >> sc_serv.conf
echo password=$pass >> sc_serv.conf
echo adminpassword=$apass >> sc_serv.conf
echo streamid=1 >> sc_serv.conf
echo streampath=/test.aac >> sc_serv.conf
echo publicserver=always >> sc_serv.conf
echo streamauthhash=12345 >> sc_serv.conf
chmod 777 sc_serv.conf
#####################################################################
echo -----install dj-------##
cd /radio/dj/
wget http://download.nullsoft.com/shoutcast/tools/sc_trans_linux_10_07_2011.tar.gz
tar -zxvf sc_trans_linux_10_07_2011.tar.gz
echo logfile=logs/sc_trans.log >> sc_trans.conf
echo calendarrewrite=0 >> sc_trans.conf
echo encoder_1=aacp >> sc_trans.conf
echo bitrate_1=$qualidade >> sc_trans.conf
echo outprotocol_1=3 >> sc_trans.conf
echo serverip_1=127.0.0.1 >> sc_trans.conf
echo serverport_1=8000 >> sc_trans.conf
echo password_1=$pass >> sc_trans.conf
echo streamid_1=1 >> sc_trans.conf
echo endpointname_1=/Bob >> sc_trans.conf
echo streamtitle=$radio >> sc_trans.conf
echo streamurl=$url >> sc_trans.conf
echo genre=$genero >> sc_trans.conf
echo playlistfile=/radio/play.lst >> sc_trans.conf
echo adminport=7998 >> sc_trans.conf
echo adminuser=$user >> sc_trans.conf
echo adminpassword=$passUI >> sc_trans.conf
chmod 777 sc_trans.conf
##################################################################
echo executando servidor
find $pasta > /radio/play.lst
cd /radio/server/
./sc_serv sc_serv.conf > /radio/shoutcast.log &
cd /radio/dj/
./sc_trans sc_trans.conf > /radio/dj.log &
exit



  


2. Minha versão...

Perfil removido
removido

(usa Nenhuma)

Enviado em 15/11/2011 - 00:18h

Sempre podemos melhorar um código, não é mesmo.

#!/bin/bash
# Instaladpor do autoDj e shoutCast
# v 1.1a

# Pasta das MP3
pasta=/*

# Configurações do server
# Senha para Dj
pass='1234'
# Senha para acesso HTTP
apass='12345'

# Configuração do autodj
# Qualiade da radio em bitrate
qualidade=98000
# Nome da sua radio
radio='nome da radio'
# Seu site
url='http://seusite.com'
# Genero da sua radio
genero='genero'
# User do testUI
user='admin'
# Senha do testUI
passUI='admin'


SERVER='http://download.nullsoft.com/shoutcast/tools'
SHOUTCAST="${SERVER}/sc_serv2_linux_07_31_2011.tar.gz"
AUTODJ="${SERVER}/sc_trans_linux_10_07_2011.tar.gz"

function installShoutCast()
{
wget $SHOUTCAST
tar -zxvf $(echo $SHOUTCAST | sed 's/*.\///g')

echo 'logfile=logs/sc_serv.log' > sc_serv.conf
echo 'w3clog=logs/sc_w3c.log' >> sc_serv.conf
echo 'banfile=control/sc_serv.ban' >> sc_serv.conf
echo 'ripfile=control/sc_serv.rip' >> sc_serv.conf
echo "password=$pass" >> sc_serv.conf
echo "adminpassword=$apass" >> sc_serv.conf
echo 'streamid=1' >> sc_serv.conf
echo 'streampath=/test.aac' >> sc_serv.conf
echo 'publicserver=always' >> sc_serv.conf
echo 'streamauthhash=12345' >> sc_serv.conf
chmod 777 sc_serv.conf
}

function installAutoDj()
{
cd /radio/dj/
wget $AUTODJ
tar -zxvf $(echo $AUTODJ | sed 's/*.\///g')

echo 'logfile=logs/sc_trans.log' > sc_trans.conf
echo 'calendarrewrite=0' >> sc_trans.conf
echo 'encoder_1=aacp' >> sc_trans.conf
echo "bitrate_1=$qualidade" >> sc_trans.conf
echo 'outprotocol_1=3' >> sc_trans.conf
echo 'serverip_1=127.0.0.1' >> sc_trans.conf
echo 'serverport_1=8000' >> sc_trans.conf
echo "password_1=$pass" >> sc_trans.conf
echo 'streamid_1=1' >> sc_trans.conf
echo 'endpointname_1=/Bob' >> sc_trans.conf
echo "streamtitle=$radio" >> sc_trans.conf
echo "streamurl=$url" >> sc_trans.conf
echo "genre=$genero" >> sc_trans.conf
echo 'playlistfile=/radio/play.lst' >> sc_trans.conf
echo 'adminport=7998' >> sc_trans.conf
echo "adminuser=$user" >> sc_trans.conf
echo "adminpassword=$passUI" >> sc_trans.conf
chmod 777 sc_trans.conf
}

mkdir -p /radio/server/
mkdir -p /radio/dj/
cd /radio/server/
_installAutoDj
_installShoutCast

echo executando servidor
find $pasta > /radio/play.lst
cd /radio/server/
./sc_serv sc_serv.conf > /radio/shoutcast.log &
cd /radio/dj/
./sc_trans sc_trans.conf > /radio/dj.log &

exit



3. Re: Criando instalador de shoutcast e auto-DJ [RESOLVIDO]

dfn
IDFNI

(usa Debian)

Enviado em 15/11/2011 - 03:22h

Estou começando a estudar scripts shell :)
muito bom script!!






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts