postrm is in ampache 3.6~alpha1-0ubuntu6.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125  | #!/bin/sh
# postrm script for Ampache
set -e
ELCA=/etc/lighttpd/conf-available
ELCE=/etc/lighttpd/conf-enabled
EAMP=/etc/ampache
UAMP=/usr/share/ampache
LDM=/usr/sbin/lighty-disable-mod
APES=/etc/apache2/sites-enabled/mythweb.conf
APE=/etc/apache2/conf.d
log=/var/log/ampache
#source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0
lighttpd_remove() {
	if [ -f $ELCA/50-ampache.conf ]; then
		rm -f $ELCA/50-ampache.conf
	fi
	if [ ! -x $LDM ] ; then
		printf "Lighttpd not installed, skipping"
	else
		$LDM ampache
	fi
	if [ -h $ELCE/50-ampache.conf ] ; then
		printf "Manually deleting lighttpd/ampache configuration link."
		rm -f $ELCE/50-ampache.conf
	fi
}
apache_remove() {
	if [ -e /etc/apache2/sites-available/ApacheAmpache ]; then
		a2dissite ApacheAmpache
		a2ensite default
		rm -f /etc/apache2/sites-available/ApacheAmpache
	fi
	if [ -e /etc/apache2/sites-available/ampvhadd ]; then
		a2dissite ampvhadd
		a2ensite default
		rm -f /etc/apache2/sites-available/ampvhadd
	fi
}
mythbuntu_apache_remove() {
	if [ -e /var/www/mythweb -a $APES ]; then
		rm -f $APE/mythbuntu.ampache.conf
	fi
}
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
	#get webserver type
	db_get ampache/webserver_type || true
	webservers="$RET"
	#Ask the webserver restart question.
	db_get ampache/restart_webserver || true
	if [ "$RET" = "false" ]; then
		#This removes everthing except config files.
		if [ -d $UAMP ]; then
			rm -rf $UAMP
		fi
		if [ -d $log ]; then
			rm -rf $log
		fi
		if [ -f /etc/logrotate.d/ampache ]; then
			rm -f /etc/logrotate.d/ampache
		fi
		if [ -f /etc/cron.daily/ampache ]; then
			rm -f /etc/cron.daily/ampache
		fi
		return 0
	elif [ "$RET" = "true" ]; then
		if [ "$webservers" = "apache2" ]; then
			if [ -d /var/www/mythweb ] && [ -f $APES ]; then
				mythbuntu_apache_remove
			else
				apache_remove
			fi
		elif [ "$webservers" = "lighttpd" ]; then
			lighttpd_remove
		else
			printf "unable to configure $webservers\n"
		fi
		if [ -x /usr/sbin/invoke-rc.d ]; then
			invoke-rc.d $webservers reload 3>/dev/null || true
		else
			/etc/init.d/$webservers reload 3>/dev/null || true
		fi
		#This removes everything except config files.
		if [ -d $UAMP ]; then
			rm -rf $UAMP
		fi
		if [ -d $log ]; then
			rm -rf $log
		fi
		if [ -f /etc/logrotate.d/ampache ]; then
			rm -f /etc/logrotate.d/ampache
		fi
		if [ -f /etc/cron.daily/ampache ]; then
			rm -f /etc/cron.daily/ampache
		fi
	else
		printf "unable to configure ampache.\n"
	fi
fi
#Remove config files on purge.  This is needed to remove user added content.
if [ "$1" = "purge" ]; then
	if [ -d $EAMP ]; then
		rm -rf $EAMP
	fi
fi
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section
exit 0
 |