Old 15th April 2015, 07:17   #1
sistematico
Junior Member
 
Join Date: Oct 2013
Posts: 8
Sorry for necro-posting.

Quote:
#!/bin/sh
#
# sct_refresh.sh: Create and Refresh a SC Trans playlist
#
# Developed by Lucas Saliés Brum a.k.a. sistematico, <lucas@archlinux.com.br>
# Based on "Dytut" work:
# http://forums.winamp.com/showpost.ph...38&postcount=6
#
# Suggested cronjob: */5 * * * * /bin/sh /home/shoutcast/bin/sct_refresh.sh
#

# Vars
TRANS_PID=$(pidof sc_trans)
TRANS_FIND=$(which find)
TRANS_KILL=$(which kill)
TRANS_CHOWN=$(which chown)
TRANS_PATH="/usr/local/musicas/"
TRANS_LIST="/home/shoutcast/lista.lst"
TRANS_USER="shoutcast"
TRANS_GROUP="shoutcast"

# DONT CHANGE BELOW

# Create playlist
$TRANS_FIND $TRANS_PATH -iname "*.mp3" > $TRANS_LIST

# Reload new playlist
$TRANS_KILL -s USR1 $TRANS_PID

# turn shuffle on/off
# $TRANS_KILL -s USR2 $TRANS_PID

# Change permissions
$TRANS_CHOWN ${TRANS_USER}:${TRANS_GROUP} $TRANS_LIST
sistematico is offline   Reply With Quote
Old 8th May 2015, 17:13   #2
sistematico
Junior Member
 
Join Date: Oct 2013
Posts: 8
Edit 1

Quote:
#!/bin/sh
#
# sct_refresh.sh: Create and Refresh a SC Trans playlist
#
# Developed by Lucas Saliés Brum a.k.a. sistematico, <lucas@archlinux.com.br>
# Based on "Dytut" work:
# http://forums.winamp.com/showpost.php?p=1806538&postcount=6
#
# Suggested cronjob: */60 * * * * /bin/sh /home/shoutcast/bin/sct_refresh.sh
#

# Vars
TRANS_HOME="/home/radio"
TRANS_PID=$(pidof sc_trans)
TRANS_FIND=$(which find)
TRANS_KILL=$(which kill)
TRANS_CHOWN=$(which chown)
TRANS_PATH="${TRANS_HOME}/musicas"
TRANS_LIST="${TRANS_HOME}/lista.lst"
TRANS_USER="radio"
TRANS_GROUP="radio"

# DONT CHANGE BELOW
# Create playlist
$TRANS_FIND $TRANS_PATH -iname "*.mp3" > $TRANS_LIST

# Reload new playlist(try one of above, maybe need root permissions)
#$TRANS_KILL -s USR1 $TRANS_PID
#$TRANS_KILL -USR1 $TRANS_PID
sudo $TRANS_KILL -SIGUSR1 $TRANS_PID

# turn shuffle on/off
# $TRANS_KILL -s USR2 $TRANS_PID

# Change permissions
# $TRANS_CHOWN ${TRANS_USER}:${TRANS_GROUP} $TRANS_LIST
Updated

Last edited by sistematico; 8th May 2015 at 17:15. Reason: Some code added
sistematico is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump