2017-03-17 12:10:31 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
2018-03-19 03:56:00 +01:00
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
export app=$YNH_APP_INSTANCE_NAME
|
2017-03-17 12:10:31 +01:00
|
|
|
|
|
|
|
# Retrieve old app settings
|
2018-03-19 03:56:00 +01:00
|
|
|
ynh_get_and_export domain path_url is_public final_path
|
2017-03-17 12:10:31 +01:00
|
|
|
|
2018-03-19 03:56:00 +01:00
|
|
|
# Normalize the url path syntax
|
|
|
|
path_url=$(ynh_normalize_url_path $path_url)
|
|
|
|
|
|
|
|
# Check web path availability
|
|
|
|
ynh_webpath_available $domain $path_url
|
|
|
|
# Check if the app can be installed with this args
|
|
|
|
ynh_final_path_available
|
|
|
|
|
|
|
|
# Install dependency
|
|
|
|
ynh_install_app_dependencies $pkg_dependencies
|
2017-03-17 12:10:31 +01:00
|
|
|
|
|
|
|
# Restore sources & data
|
2018-03-19 03:56:00 +01:00
|
|
|
ynh_restore
|
2017-03-17 12:10:31 +01:00
|
|
|
|
|
|
|
# Restore permissions to app files
|
2018-03-19 03:56:00 +01:00
|
|
|
ynh_set_default_perm "$final_path"
|
2017-03-17 12:10:31 +01:00
|
|
|
|
2018-03-19 03:56:00 +01:00
|
|
|
# If app is public, add url to SSOWat conf as skipped_uris
|
|
|
|
ynh_sso_access "/"
|
2017-03-17 12:10:31 +01:00
|
|
|
|
|
|
|
# Restart webserver
|
2018-03-19 03:56:00 +01:00
|
|
|
systemctl reload nginx
|
|
|
|
|
|
|
|
# Send message to the admin
|
|
|
|
message="If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/svgedit_ynh"
|
|
|
|
|
|
|
|
ynh_send_readme_to_admin "$message"
|