diff --git a/scripts/install b/scripts/install index ba5309c..63528c1 100644 --- a/scripts/install +++ b/scripts/install @@ -105,7 +105,7 @@ chown -R "$app": "$final_path" #================================================= # Make app public if necessary -if [ $is_public -eq "1" ] +if [ "$is_public" -eq "1" ] then # unprotected_uris allows SSO credentials to be passed anyway. ynh_app_setting_set "$app" unprotected_uris "/" diff --git a/scripts/restore b/scripts/restore index d482e68..7c3facd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,17 +27,17 @@ ynh_abort_if_errors app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get $app domain) -path_url=$(ynh_app_setting_get $app path) -final_path=$(ynh_app_setting_get $app final_path) +domain=$(ynh_app_setting_get "$app" domain) +path_url=$(ynh_app_setting_get "$app" path) +final_path=$(ynh_app_setting_get "$app" final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_webpath_available $domain $path_url \ +ynh_webpath_available "$domain" "$path_url" \ || ynh_die "Path not available: ${domain}${path_url}" -test ! -d $final_path \ +test ! -d "$final_path" \ || ynh_die "There is already a directory: $final_path " diff --git a/scripts/upgrade b/scripts/upgrade index 747f5a3..2725ef7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,12 +15,12 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get $app domain) -path_url=$(ynh_app_setting_get $app path) -admin=$(ynh_app_setting_get $app admin) -is_public=$(ynh_app_setting_get $app is_public) -final_path=$(ynh_app_setting_get $app final_path) -language=$(ynh_app_setting_get $app language) +domain=$(ynh_app_setting_get "$app" domain) +path_url=$(ynh_app_setting_get "$app" path) +admin=$(ynh_app_setting_get "$app" admin) +is_public=$(ynh_app_setting_get "$app" is_public) +final_path=$(ynh_app_setting_get "$app" final_path) +language=$(ynh_app_setting_get "$app" language) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -28,23 +28,23 @@ language=$(ynh_app_setting_get $app language) # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set $app is_public 1 + ynh_app_setting_set "$app" is_public 1 is_public=1 elif [ "$is_public" = "No" ]; then - ynh_app_setting_set $app is_public 0 + ynh_app_setting_set "$app" is_public 0 is_public=0 fi # If db_name doesn't exist, create it -if [ -z $db_name ]; then - db_name=$(ynh_sanitize_dbid $app) - ynh_app_setting_set $app db_name $db_name +if [ -z "$db_name" ]; then + db_name=$(ynh_sanitize_dbid "$app") + ynh_app_setting_set "$app" db_name "$db_name" fi # If final_path doesn't exist, create it -if [ -z $final_path ]; then - final_path=/var/www/$app - ynh_app_setting_set $app final_path $final_path +if [ -z "$final_path" ]; then + final_path="/var/www/$app" + ynh_app_setting_set "$app" final_path "$final_path" fi #================================================= @@ -65,7 +65,7 @@ ynh_abort_if_errors #================================================= # Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) +path_url=$(ynh_normalize_url_path "$path_url") #================================================= # STANDARD UPGRADE STEPS @@ -114,7 +114,7 @@ chown -R "$app": "$final_path" #================================================= # Make app public if necessary -if [ $is_public -eq "1" ] +if [ "$is_public" -eq "1" ] then # unprotected_uris allows SSO credentials to be passed anyway. ynh_app_setting_set "$app" unprotected_uris "/" @@ -126,4 +126,4 @@ fi # RELOAD NGINX #================================================= -systemctl reload nginx +systemctl reload nginx \ No newline at end of file