summaryrefslogtreecommitdiff
path: root/debian/tt-rss-pgsql.postrm
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-11-11 00:02:53 +0400
committerAndrew Dolgov <[email protected]>2011-11-11 00:02:53 +0400
commitd0cafcf4a048bfcc72d9523d20d61ba719e566cd (patch)
tree8d99e9b8f7009076da1f507bde405d4d0f8cd865 /debian/tt-rss-pgsql.postrm
parent17140b71edaad9160742a33f094f94479bbbd573 (diff)
add debianization scripts based on work by Florent USSEIL
Diffstat (limited to 'debian/tt-rss-pgsql.postrm')
-rw-r--r--debian/tt-rss-pgsql.postrm42
1 files changed, 42 insertions, 0 deletions
diff --git a/debian/tt-rss-pgsql.postrm b/debian/tt-rss-pgsql.postrm
new file mode 100644
index 000000000..85e43a283
--- /dev/null
+++ b/debian/tt-rss-pgsql.postrm
@@ -0,0 +1,42 @@
+#!/bin/sh
+set -e
+
+PACKAGE=tt-rss-pgsql
+
+# source debconf stuff
+if [ -f /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+fi
+
+# Un-configure and restart webservers
+db_get $PACKAGE/webserver || true
+WEBSERVER="$RET";
+if $WEBSERVER; then
+ if [ -L /etc/apache2/conf.d/$PACKAGE.conf ]; then
+ rm -f /etc/apache2/conf.d/$PACKAGE.conf
+ fi
+fi
+
+if apache2ctl configtest 2>/dev/null; then
+ invoke-rc.d apache2 force-reload || true
+else
+ echo "apache need to be manually reloaded"
+fi
+
+# dbconfig-common
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
+ . /usr/share/dbconfig-common/dpkg/postrm.pgsql
+ dbc_go $PACKAGE $@
+fi
+
+if [ "$1" = "purge" ]; then
+ # remove database config
+ rm -f /etc/$PACKAGE/database.php
+ if which ucf >/dev/null 2>&1; then
+ ucf --purge /etc/$PACKAGE/database.php
+ fi
+ db_purge
+fi
+
+exit 0
+#DEBHELPER#