Remove db only if command is available
This commit is contained in:
parent
1b9c7f9902
commit
996abf57ec
1 changed files with 7 additions and 2 deletions
7
debian/postrm
vendored
7
debian/postrm
vendored
|
@ -54,10 +54,15 @@ case "$1" in
|
||||||
rm -rf ${gitlab_cache_path}
|
rm -rf ${gitlab_cache_path}
|
||||||
rm -rf ${gitlab_pid_path}
|
rm -rf ${gitlab_pid_path}
|
||||||
# Don't fail if user is already removed
|
# Don't fail if user is already removed
|
||||||
gitlab_user=${gitlab_user:-gitlab}
|
if [ -z "${gitlab_user}" ]; then
|
||||||
|
# If gitlab_user variable is unset or empty, use "gitlab" as default.
|
||||||
|
gitlab_user=gitlab
|
||||||
|
fi
|
||||||
id -u ${gitlab_user} && userdel -r ${gitlab_user}
|
id -u ${gitlab_user} && userdel -r ${gitlab_user}
|
||||||
rm -rf ${gitlab_data_dir}
|
rm -rf ${gitlab_data_dir}
|
||||||
|
if [ -x /usr/bin/dropdb ]; then
|
||||||
su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production"
|
su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production"
|
||||||
|
fi
|
||||||
rm -rf ${gitlab_ssl_path}
|
rm -rf ${gitlab_ssl_path}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue