[20e94f]: scripts / S99oggstreamer  Maximize  Restore  History

Download this file

45 lines (32 with data), 1.2 kB

#!/bin/sh
cd /mnt/flash/root/bin

WEBROOT=/mnt/flash/www
FILECMP=/mnt/flash/root/bin/filecmp
TEMP_DIR=/tmp
PLAYLIST=playlist.m3u
INDEXFILE=index.html

ipaddr=$(/sbin/ifconfig | grep 'inet addr:' | ./get_ipaddr)
usesighttpd=$(/mnt/flash/root/bin/checkconfig -b internalserver.enabled)

# generate Playlist
./busybox sed "s/IPADDR/$ipaddr/g" $WEBROOT/playlist.m3u.template > $TEMP_DIR/$PLAYLIST

# ... and copy if it differs from the previous version
cmpresult=$($FILECMP $TEMP_DIR/$PLAYLIST $WEBROOT/$PLAYLIST)

if [ "$cmpresult" != "1" ]; then
	cp $TEMP_DIR/$PLAYLIST $WEBROOT/$PLAYLIST
fi

# generate index.html
if [ "$usesighttpd" == "TRUE" ]; then
	
	./busybox sed "s/IPADDR/$ipaddr/g" $WEBROOT/index_sighttpd.template > $TEMP_DIR/$INDEXFILE
else 
	./busybox sed "s/IPADDR/$ipaddr/g" $WEBROOT/index.template > $TEMP_DIR/$INDEXFILE
fi

# ... and copy if it differs from the previous version
cmpresult=$($FILECMP $TEMP_DIR/$INDEXFILE $WEBROOT/$INDEXFILE)

if [ "$cmpresult" != "1" ]; then
	cp $TEMP_DIR/$INDEXFILE $WEBROOT/$INDEXFILE
fi



if [ "$usesighttpd" == "TRUE" ]; then
	./oggs_app | ./sighttpd -f /etc/sighttpd.conf 2> /var/log/sighttpd.log & 
else 
	./oggs_app > /dev/null &
fi

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks