pre_install() {
	echo ""
}

pre_upgrade() {
  pre_install
}

pre_remove() {
  pre_install
}

post_install() {
	. /etc/systemconfig
	mkdir /myth/ipodfeed
	chown mythtv:users /myth/ipodfeed
	ln -s /myth/ipodfeed /data/srv/httpd/htdocs/ipodfeed
	cp /usr/bin/myth2ipod /tmp
	sed -e "s/REPLACEME/$hostname/g" /tmp/myth2ipod > /usr/bin/myth2ipod
	chown -R mythtv:http /myth/ipodfeed
	
	
}

post_upgrade() {
	 /usr/bin/myth2ipod -rebuild
}

post_remove() {
 	rm -fr /data/srv/httpd/htdocs/ipodfeed 
}

op=$1
shift

$op $*