diff --git a/scripts/_common.sh b/scripts/_common.sh index 96f7834..44ca232 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -258,10 +258,10 @@ ynh_set_default_perm () { } ynh_sso_access () { - sudo yunohost app setting $app unprotected_uris -v "/" + ynh_app_setting_set $app unprotected_uris -v "/" if [[ $is_public -eq 0 ]]; then - sudo yunohost app setting $app protected_uris -v "$1" + ynh_app_setting_set $app protected_uris -v "$1" fi sudo yunohost app ssowatconf } diff --git a/scripts/backup b/scripts/backup index 18ccf63..5e6e03f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,9 +10,9 @@ set -e app=$YNH_APP_INSTANCE_NAME # Retrieve arguments -domain=$(sudo yunohost app setting $app domain) -path=$(sudo yunohost app setting $app path) -local_path=$(sudo yunohost app setting $app local_path) +domain=$(ynh_app_setting_get $app domain) +path=$(ynh_app_setting_get $app path) +local_path=$(ynh_app_setting_get $app local_path) # Copy the app files ynh_backup "$local_path" "sources" diff --git a/scripts/remove b/scripts/remove index a2fdb27..c6c0d86 100755 --- a/scripts/remove +++ b/scripts/remove @@ -4,7 +4,7 @@ source _common.sh app=$YNH_APP_INSTANCE_NAME user=$app -local_path=$(sudo yunohost app setting $app local_path) +local_path=$(ynh_app_setting_get $app local_path) domain=$(ynh_app_setting_get $app domain) ynh_mysql_remove_db "$user" "$app" diff --git a/scripts/upgrade b/scripts/upgrade index e91a1ef..8b79e65 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,13 +7,13 @@ ynh_trap_on export app=$YNH_APP_INSTANCE_NAME user=$app -export domain=$(sudo yunohost app setting $app domain) -export path=$(sudo yunohost app setting $app path) -export admin=$(sudo yunohost app setting $app admin) -db_pwd=$(sudo yunohost app setting $app mysqlpwd) -export local_path=$(sudo yunohost app setting $app local_path) -export is_public=$(sudo yunohost app setting $app is_public || echo 0) -export prefix=$(sudo yunohost app setting $app prefix || echo 'prefix_') +export domain=$(ynh_app_setting_get $app domain) +export path=$(ynh_app_setting_get $app path) +export admin=$(ynh_app_setting_get $app admin) +db_pwd=$(ynh_app_setting_get $app mysqlpwd) +export local_path=$(ynh_app_setting_get $app local_path) +export is_public=$(ynh_app_setting_get $app is_public || echo 0) +export prefix=$(ynh_app_setting_get $app prefix || echo 'prefix_') version=$(ynh_read_json "/etc/yunohost/apps/$app/manifest.json" 'version' 2> /dev/null || echo '2.0.5') last_version=$(ynh_read_manifest 'version')