mirror of
https://github.com/YunoHost-Apps/jitsi_ynh.git
synced 2024-09-03 19:35:57 +02:00
update helper
This commit is contained in:
parent
c462d1889e
commit
018b088bc0
1 changed files with 9 additions and 9 deletions
|
@ -7,7 +7,7 @@
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies="openjdk-8-jre-headless|openjdk-11-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap"
|
pkg_dependencies="openjdk-8-jre-headless|openjdk-11-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap"
|
||||||
|
|
||||||
ynh_app_dependencies="prosody_ynh"
|
ynh_app_dependencies="prosody"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
@ -30,7 +30,7 @@ ynh_version_gt ()
|
||||||
|
|
||||||
# Install other YunoHost apps
|
# Install other YunoHost apps
|
||||||
#
|
#
|
||||||
# usage: ynh_install_apps --apps="a_ynh b_ynh?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666"
|
# usage: ynh_install_apps --apps="appfoo appbar?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666"
|
||||||
# | arg: -a, --apps= - apps to install
|
# | arg: -a, --apps= - apps to install
|
||||||
#
|
#
|
||||||
# Requires YunoHost version *.*.* or higher.
|
# Requires YunoHost version *.*.* or higher.
|
||||||
|
@ -46,14 +46,14 @@ ynh_install_apps() {
|
||||||
local apps_list=($(echo $apps | tr " " "\n"))
|
local apps_list=($(echo $apps | tr " " "\n"))
|
||||||
|
|
||||||
# For each app
|
# For each app
|
||||||
for i in "${apps_list[@]}"
|
for oneapp_and_its_args in "${apps_list[@]}"
|
||||||
do
|
do
|
||||||
# Retrieve the name of the app (part before _ynh)
|
# Retrieve the name of the app (part before _ynh)
|
||||||
local oneapp=$(echo "$i" | awk -F'_ynh' '{print $1}')
|
local oneapp=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $1}')
|
||||||
[ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to install"
|
[ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to install"
|
||||||
|
|
||||||
# Retrieve the arguments of the app (part after ?)
|
# Retrieve the arguments of the app (part after ?)
|
||||||
local oneargument=$(echo "$i" | awk -F'?' '{print $2}')
|
local oneargument=$(echo "$oneapp_and_its_args" | awk -F'?' '{print $2}')
|
||||||
[ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\""
|
[ ! -z "$oneargument" ] && oneargument="--args \"$oneargument\""
|
||||||
|
|
||||||
if ! yunohost app list | grep -q "$oneapp"
|
if ! yunohost app list | grep -q "$oneapp"
|
||||||
|
@ -72,7 +72,7 @@ ynh_install_apps() {
|
||||||
#
|
#
|
||||||
# apps will be removed only if no other apps need them.
|
# apps will be removed only if no other apps need them.
|
||||||
#
|
#
|
||||||
# usage: ynh_remove_apps --apps="a_ynh b_ynh?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666"
|
# usage: ynh_remove_apps --apps="appfoo appbar?domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666"
|
||||||
# | arg: -a, --apps= - apps to install
|
# | arg: -a, --apps= - apps to install
|
||||||
#
|
#
|
||||||
# Requires YunoHost version *.*.* or higher.
|
# Requires YunoHost version *.*.* or higher.
|
||||||
|
@ -91,7 +91,7 @@ ynh_remove_apps() {
|
||||||
for i in "${apps_list[@]}"
|
for i in "${apps_list[@]}"
|
||||||
do
|
do
|
||||||
# Retrieve the name of the app (part before _ynh)
|
# Retrieve the name of the app (part before _ynh)
|
||||||
local oneapp=$(echo "$i" | awk -F'_ynh' '{print $1}')
|
local oneapp=$(echo "$i" | awk -F'?' '{print $1}')
|
||||||
[ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to remove"
|
[ -z "$oneapp" ] && ynh_die --message="You didn't provided a YunoHost app to remove"
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=require_$oneapp
|
ynh_app_setting_delete --app=$app --key=require_$oneapp
|
||||||
|
@ -103,7 +103,7 @@ ynh_remove_apps() {
|
||||||
for installed_app in $installed_apps
|
for installed_app in $installed_apps
|
||||||
do
|
do
|
||||||
local installed_app_required_by=$(ynh_app_setting_get --app=$installed_app --key="require_$oneapp")
|
local installed_app_required_by=$(ynh_app_setting_get --app=$installed_app --key="require_$oneapp")
|
||||||
if [[ $installed_app_required_by ]]
|
if [[ -n "$installed_app_required_by" ]]
|
||||||
then
|
then
|
||||||
required_by="${installed_app_required_by}"
|
required_by="${installed_app_required_by}"
|
||||||
fi
|
fi
|
||||||
|
@ -111,7 +111,7 @@ ynh_remove_apps() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# If $oneapp is no more required
|
# If $oneapp is no more required
|
||||||
if [[ ! $required_by ]]
|
if [[ -z "$required_by" ]]
|
||||||
then
|
then
|
||||||
# Remove $oneapp
|
# Remove $oneapp
|
||||||
ynh_print_info --message="Removing of $oneapp"
|
ynh_print_info --message="Removing of $oneapp"
|
||||||
|
|
Loading…
Add table
Reference in a new issue