--- a/scripts/S99oggstreamer
+++ b/scripts/S99oggstreamer
@@ -1,12 +1,41 @@
 #!/bin/sh
 cd /mnt/flash/root/bin
-/sbin/ifconfig | grep 'inet addr:' | ./gen_playlist
 
+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
-	cp /mnt/flash/www/index.dis /mnt/flash/www/index.html
+	
+	./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 &