#!/bin/sh

# Uninstall script for the Darwin Streaming Server

echo;echo Uninstalling Darwin Streaming Server;echo

if [ `uname` != "SunOS" ]; then
        USERID=`id -u`
else
        USERID=`/usr/xpg4/bin/id -u`
fi

if [ $USERID = 0 ]; then

	## /etc/streaming
	echo removing "/etc/streaming"
	rm -rf /etc/streaming
	
	## /var/streaming
	echo removing "/var/streaming/readme.pdf"
	rm -f /var/streaming/readme.pdf
	
	echo removing "/usr/local/logs"
	rm -rf /var/streaming/logs
	
	echo removing "/usr/local/playlists"
	rm -rf /var/streaming/playlists
	
	echo removing "/var/streaming/AdminHtml/l"
	rm -rf /var/streaming/AdminHtml/
	
	echo removing "/var/streaming"
	rmdir /var/streaming
	
	## /usr/local/movies
	echo removing "/usr/local/movies/sample.mov"
	rm -f  /usr/local/movies/sample.mov
	
	echo removing "/usr/local/movies/sample_56kbit.mov"
	rm -f  /usr/local/movies/sample_56kbit.mov
	
	echo removing "/usr/local/movies/sample_100kbit.mov"
	rm -f  /usr/local/movies/sample_100kbit.mov
	
	echo removing "/usr/local/movies/sample_300kbit.mov"
	rm -f  /usr/local/movies/sample_300kbit.mov
	
	echo removing "/usr/local/movies/sample.mp3"
	rm -f  /usr/local/movies/sample.mp3
	
	echo removing "/usr/local/movies"
	rmdir /usr/local/movies
	
	## Binaries
	echo removing "/usr/local/sbin/DarwinStreamingServer"
	rm -f /usr/local/sbin/DarwinStreamingServer
	
	echo removing "/usr/local/sbin/StreamingServerModules"
	rm -rf /usr/local/sbin/StreamingServerModules
	
	echo removing "/usr/local/sbin/streamingadminserver.pl"
	rm -f  /usr/local/sbin/streamingadminserver.pl
	
	echo removing "/usr/local/bin/StreamingLoadTool"
	rm -f  /usr/local/bin/StreamingLoadTool
	
	echo removing "/usr/local/bin/PlaylistBroadcaster"
	rm -f /usr/local/bin/PlaylistBroadcaster
	
	echo removing "/usr/local/bin/MP3Broadcaster"
	rm -f /usr/local/bin/MP3Broadcaster
	
	echo removing "/usr/local/bin/qtpasswd"
	rm -f /usr/local/bin/qtpasswd


else

	echo "Unable to perform uninstall"
	echo "You must be root";echo
	exit 1

fi

