2024-02-26 02:35:03 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
|
2024-02-26 03:18:19 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC GETTERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
get__default_matrix_server() {
|
|
|
|
|
|
|
|
default_matrix_server=$(ynh_app_setting_get --app="$app" --key=default_matrix_server)
|
|
|
|
|
|
|
|
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-04-15 05:08:20 +02:00
|
|
|
ynh_replace_string --match_string="=\"$old_value\"" --replace_string="=\"$default_matrix_server\"" --target_file="$install_dir/main.dart.js"
|
2024-02-26 02:35:03 +01:00
|
|
|
|
|
|
|
ynh_app_setting_set --app="$app" --key=default_matrix_server --value="$default_matrix_server"
|
|
|
|
}
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
ynh_app_config_run "$1"
|