78 lines
1.8 KiB
Plaintext
78 lines
1.8 KiB
Plaintext
![]() |
#!/bin/sh
|
||
|
# postrm script for gallery3
|
||
|
#
|
||
|
# see: dh_installdeb(1)
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [ -f /usr/share/debconf/confmodule ]; then
|
||
|
. /usr/share/debconf/confmodule
|
||
|
fi
|
||
|
if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
|
||
|
. /usr/share/dbconfig-common/dpkg/postrm.mysql
|
||
|
dbc_go gallery3 "$@"
|
||
|
fi
|
||
|
|
||
|
|
||
|
case "$1" in
|
||
|
purge)
|
||
|
|
||
|
db_get gallery3/reconfigure || true
|
||
|
|
||
|
for websvrs in apache apache-perl apache-ssl apache2; do
|
||
|
rm -f /etc/$websvrs/conf.d/gallery3
|
||
|
done
|
||
|
|
||
|
webservers="$RET"
|
||
|
restart=""
|
||
|
|
||
|
for webserver in $webservers; do
|
||
|
webserver=${webserver%,}
|
||
|
|
||
|
case "$webserver" in
|
||
|
apache|apache-perl|apache-ssl|apache2)
|
||
|
rm -f /etc/$webserver/conf.d/gallery3
|
||
|
test -x /usr/sbin/$webserver || continue
|
||
|
db_reset gallery3/restart || true
|
||
|
db_subst gallery3/restart webserver "$webserver" || true
|
||
|
db_input high gallery3/restart || true
|
||
|
db_go || true
|
||
|
db_get gallery3/restart-webserver || true
|
||
|
if [ "$RET" = "true" ]; then
|
||
|
restart="$restart $webserver"
|
||
|
fi
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
|
||
|
rmdir --ignore-fail-on-non-empty /etc/gallery3 || true
|
||
|
|
||
|
for webserver in $restart; do
|
||
|
webserver=${webserver%,}
|
||
|
if [ -x /usr/sbin/invoke-rc.d ]; then
|
||
|
invoke-rc.d $webserver restart
|
||
|
else
|
||
|
/etc/init.d/$webserver restart
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
rm -rf /var/lib/gallery3
|
||
|
|
||
|
;;
|
||
|
|
||
|
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||
|
;;
|
||
|
|
||
|
*)
|
||
|
echo "postrm called with unknown argument \`$1'" >&2
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
# dh_installdeb will replace this with shell code automatically
|
||
|
# generated by other debhelper scripts.
|
||
|
|
||
|
#DEBHELPER#
|
||
|
|
||
|
exit 0
|