Merge pull request #2271 from dokku/2106-purge-dokku-user

Handle purging the dokku user, group, and logs directory during `apt-get purge`
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2016-06-28 20:27:03 -04:00
commit bd8ca6ca5c
1 file changed
+6
+6
View File
@@ -8,6 +8,7 @@ fi
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}" readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}" readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
readonly DOKKU_LOGS_DIR="${DOKKU_LOGS_DIR:="/var/log/dokku"}"
main() { main() {
if [[ -f /etc/systemd/system/dokku-installer.conf ]] || [[ -f /etc/init/dokku-installer.conf ]]; then if [[ -f /etc/systemd/system/dokku-installer.conf ]] || [[ -f /etc/init/dokku-installer.conf ]]; then
@@ -40,6 +41,11 @@ main() {
find ${DOKKU_ROOT} -type d -empty -delete find ${DOKKU_ROOT} -type d -empty -delete
fi fi
rm -rf "${DOKKU_LOGS_DIR}"
deluser dokku || true
delgroup dokku || true
db_purge db_purge
fi fi
} }