From 11eea48fae7f4511e26e3e4cc1fef8e8b3945ce9 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 2 Jul 2023 18:47:44 +0000 Subject: [PATCH] Update config bug corrected my bad --- scripts/config | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/config b/scripts/config index 39e8884..51edbc6 100644 --- a/scripts/config +++ b/scripts/config @@ -59,7 +59,9 @@ set__allowed_local_3pids_email() { sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" else sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3EMAIL\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" - ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value="${allowed_local_3pids_email}" + fi + + ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value="${allowed_local_3pids_email}" } get__allowed_local_3pids_msisdn() { @@ -72,7 +74,8 @@ set__allowed_local_3pids_msisdn() { sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|#\1#\2#\3\4\5#\6#\7\8\9|" "/etc/matrix-$app/homeserver.yaml" else sed -i -z -r "s|#?([^\S\n]*allowed_local_3pids:\n)#?([^\S\n]*-[^\S\n]*medium: email\n)#?([^\S\n]*pattern:[^\S\n]*')([^']*)('\n)#?([^\S\n]*-[^\S\n]*medium: msisdn\n)#?([^\S\n]*pattern: ')([^']*)('?)|\1#\2#\3\4\5#\6#\7MSISDN\9|" "/etc/matrix-$app/homeserver.yaml" - ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value="${allowed_local_3pids_msisdn}" + fi + ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value="${allowed_local_3pids_msisdn}" } get__auto_join_rooms() { @@ -97,7 +100,8 @@ set__auto_join_rooms() { myregex="${myregex}\n\n|"; sed -i -z -r "${myregex}" "/etc/matrix-$app/homeserver.yaml" fi - + + ynh_app_setting_set --app=$app --key=auto_join_rooms --value="${auto_join_rooms}" } #=================================================