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

Fix carddav plugin setup

Fix deprecrated yunohost app list command
Escape strings for ynh_replace_string
This commit is contained in:
tituspijean 2020-11-22 11:23:25 +01:00
parent 8a93cb357e
commit 77f00095bb
2 changed files with 4 additions and 6 deletions

View file

@ -162,8 +162,7 @@ then
# Look for installed and supported CardDAV servers
for carddav_app in "nextcloud" "baikal"
do
carddav_app_id=$(yunohost app list --installed -f $carddav_app \
--output-as json | grep -Po '"id":[ ]?"\K.*?(?=")' | head -1)
carddav_app_id=$(yunohost app list | grep "id: $carddav_app" | grep -Po 'id: \K(.*)' | head -n 1)
if [ -n "$carddav_app_id" ]
then
carddav_server=1
@ -172,8 +171,8 @@ then
carddav_path=$(ynh_app_setting_get --app=$carddav_app_id --key=path)
carddav_url="https://${carddav_domain}${carddav_path%/}"
ynh_replace_string --match_string="{${carddav_app}_url}" --replace_string="$carddav_url" --target_file="$carddav_tmp_config"
ynh_replace_string --match_string="/* PRESET FOR: $carddav_app" --replace_string="" --target_file="$carddav_tmp_config"
ynh_replace_string --match_string="END: $carddav_app */" --replace_string="" --target_file="$carddav_tmp_config"
ynh_replace_string --match_string="\/\* PRESET FOR: $carddav_app" --replace_string="" --target_file="$carddav_tmp_config"
ynh_replace_string --match_string="END: $carddav_app \*\/" --replace_string="" --target_file="$carddav_tmp_config"
fi
done

View file

@ -209,8 +209,7 @@ then
# Look for installed and supported CardDAV servers
for carddav_app in "nextcloud" "baikal"
do
carddav_app_id=$(yunohost app list --installed -f $carddav_app \
--output-as json | grep -Po '"id":[ ]?"\K.*?(?=")' | head -1)
carddav_app_id=$(yunohost app list | grep "id: $carddav_app" | grep -Po 'id: \K(.*)' | head -n 1)
if [ -n "$carddav_app_id" ]
then
carddav_server=1