1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wekan_ynh.git synced 2024-09-03 20:36:09 +02:00

Update ynh_mongo_db

This commit is contained in:
yalh76 2020-08-06 02:07:06 +02:00
parent 9342db1424
commit 592a0594a6

View file

@ -114,7 +114,7 @@ EOF
# | arg: -c, --command= - the command to evaluate # | arg: -c, --command= - the command to evaluate
# | arg: -e, --eval - evaluate instead of execute the command. # | arg: -e, --eval - evaluate instead of execute the command.
# #
# Requires YunoHost version 3.5.0 or higher. #
ynh_mongo_exec_as_root() { ynh_mongo_exec_as_root() {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=cde local legacy_args=cde
@ -335,7 +335,7 @@ ynh_mongo_remove_db() {
# #
# usage: ynh_mongo_test_if_first_run # usage: ynh_mongo_test_if_first_run
# #
# Requires YunoHost version 2.7.13 or higher. #
ynh_mongo_test_if_first_run() { ynh_mongo_test_if_first_run() {
# Make sure Mongodb is indeed installed # Make sure Mongodb is indeed installed
@ -376,6 +376,11 @@ ynh_mongo_test_if_first_run() {
fi fi
} }
# Install MongoDB
#
# usage: ynh_mongo_install
#
#
ynh_mongo_install() { ynh_mongo_install() {
# Define Mongo Service Name # Define Mongo Service Name
if [ "$(lsb_release --codename --short)" = "buster" ]; then if [ "$(lsb_release --codename --short)" = "buster" ]; then
@ -385,10 +390,16 @@ ynh_mongo_install() {
fi fi
} }
# Remove MongoDB
# Only remove the MongoDB service integration in YunoHost for now
# if MongoDB package as been removed
#
# usage: ynh_mongo_remove
#
#
ynh_mongo_remove() { ynh_mongo_remove() {
# Only remove the mongodb service if it is not installed. # Only remove the mongodb service if it is not installed.
if ! ynh_package_is_installed --package="mongodb" if ! ynh_package_is_installed --package="mongodb*"
then then
yunohost service remove $MONGODB_SERVICENAME yunohost service remove $MONGODB_SERVICENAME
# ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE # ynh_secure_remove --file=$MONGO_ROOT_PWD_FILE