#!/bin/sh -e

# If we have a second argument, it's a prior version number
if [ "$2." != "." ]; then

   if [ -f /usr/sbin/icecast ]; then
     # Try to stop the daemon (shouldn't error if not running)
     start-stop-daemon --stop --signal 9 --oknodo --quiet --exec /usr/sbin/icecast
   fi
fi

if [ -f /etc/default/icecast ]; then
echo "***NOTICE***"
echo "There have been severl security bugs found in Icecast. You are being"
echo "upgraded to latest stable version, 1.3.11"
echo
echo "/etc/default/icecast no longer needed"
echo
echo "You will need to upgrade /etc/icecast/icecast.conf to reflect your settings"
echo "If you need any assistance look for dmz or others on IRC at openprojects.net"
echo "icecast channel"
echo
echo "***NOTICE***"
echo "<Press Enter to continue>"
read junkstuff
fi
