memgraph/release/debian/postrm
Teon Banek 65f4c53529 Cleanup and reorganize release directory
Summary:
Add packager variable for Arch package.
Move docker packaging to docker subfolder.
Remove web_browser script.
Move debian from cmake dir to release.
Add README.md to release dir.

Reviewers: mferencevic, buda

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1104
2018-01-15 10:12:59 +01:00

65 lines
1.8 KiB
Bash

#!/bin/sh
# postrm script for memgraph
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
var_files="/var/lib/memgraph /var/log/memgraph"
case "$1" in
purge)
# Remove 'var/*/memgraph' directories, even if they contain something.
for var_file in $var_files; do
rm -rf $var_file
done
# Don't remove the 'memgraph' user, since we cannot be sure whether it
# existed before.
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
# Default behaviour does what we expect, removes untouched installed
# files but keeps configuration.
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Remove and purge systemd memgraph.service. The following was autogenerated
# by dh_systemd_enable and dh_systemd_start.
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
fi
if [ "$1" = "remove" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask memgraph.service >/dev/null
fi
fi
if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge memgraph.service >/dev/null
deb-systemd-helper unmask memgraph.service >/dev/null
fi
fi
exit 0