2024-02-26 02:35:03 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS
|
|
|
|
#=================================================
|
|
|
|
|
2024-08-30 22:55:10 +02:00
|
|
|
install_dir=$(ynh_app_setting_get --key=install_dir)
|
2024-02-26 03:18:19 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC GETTERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
get__default_matrix_server() {
|
|
|
|
|
2024-08-30 22:55:10 +02:00
|
|
|
default_matrix_server=$(ynh_app_setting_get --key=default_matrix_server)
|
2024-02-26 03:18:19 +01:00
|
|
|
|
|
|
|
echo "$default_matrix_server"
|
|
|
|
}
|
2024-02-26 02:35:03 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETTERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
set__default_matrix_server() {
|
|
|
|
|
2024-04-15 05:08:20 +02:00
|
|
|
old_value=${old[default_matrix_server]}
|
|
|
|
|
2024-02-26 02:35:03 +01:00
|
|
|
# patching main.dart.js to replace the default matrix server
|
2024-08-30 22:55:10 +02:00
|
|
|
ynh_replace --match="=\"$old_value\"" --replace="=\"$default_matrix_server\"" --file="$install_dir/main.dart.js"
|
2024-02-26 02:35:03 +01:00
|
|
|
|
2024-08-30 22:55:10 +02:00
|
|
|
ynh_app_setting_set --key=default_matrix_server --value="$default_matrix_server"
|
2024-02-26 02:35:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
ynh_app_config_run "$1"
|