1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/peertube_ynh.git synced 2024-09-03 19:56:29 +02:00

Implementing prosody

This commit is contained in:
yalh76 2022-02-06 02:01:51 +01:00
parent 0e570c97c3
commit 1a4f04275f
4 changed files with 40 additions and 5 deletions

View file

@ -93,9 +93,13 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
if ! yunohost app list | grep -q "prosody" if ! yunohost app list | grep -q "prosody"
then then
yunohost app install prosody --args "domain=$domain&admin=$admin&language=$language&password=$password" yunohost app install prosody --force
else
yunohost app upgrade prosody --force
fi fi
ynh_app_setting_set --app=$app --key=require_prosody --value="1"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================

View file

@ -110,6 +110,31 @@ ynh_script_progression --message="Removing dependencies..."
ynh_remove_nodejs ynh_remove_nodejs
ynh_remove_app_dependencies ynh_remove_app_dependencies
# Remove Prosody
ynh_app_setting_delete --app=$app --key=require_prosody
# List apps requiring Prosody
installed_apps=$(yunohost app list | grep -oP 'id: \K.*$')
required_by=""
installed_app_required_by=""
for installed_app in $installed_apps
do
installed_app_required_by=$(ynh_app_setting_get --app=$installed_app --key="require_prosody")
if [[ $installed_app_required_by ]]
then
required_by="${installed_app_required_by}"
fi
installed_app_required_by=""
done
# If Prosody is no more required
if [[ ! $required_by ]]
then
# Remove Prosody
ynh_print_info --message="Removing of Prosody"
yunohost app remove prosody --purge
fi
#================================================= #=================================================
# CLOSE A PORT # CLOSE A PORT
#================================================= #=================================================

View file

@ -104,9 +104,13 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
if ! yunohost app list | grep -q "prosody" if ! yunohost app list | grep -q "prosody"
then then
yunohost app install prosody --args "domain=$domain&admin=$admin&language=$language&password=$password" yunohost app install prosody --force
else
yunohost app upgrade prosody --force
fi fi
ynh_app_setting_set --app=$app --key=require_prosody --value="1"
#================================================= #=================================================
# RESTORE THE POSTGRESQL DATABASE # RESTORE THE POSTGRESQL DATABASE
#================================================= #=================================================

View file

@ -218,11 +218,13 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
if ! yunohost app list | grep -q "prosody" if ! yunohost app list | grep -q "prosody"
then then
yunohost app install prosody --args "domain=$domain&admin=$admin&language=$language&password=$password" yunohost app install prosody --force
elfi else
yunohost app upgrade yunohost app upgrade prosody --force
fi fi
ynh_app_setting_set --app=$app --key=require_prosody --value="1"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================