2016-06-13 22:03:33 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-03 23:41:51 +02:00
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2020-06-15 01:58:37 +02:00
|
|
|
source _common.sh
|
2020-06-03 23:41:51 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
2024-02-28 21:07:14 +01:00
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
2020-06-03 23:41:51 +02:00
|
|
|
#=================================================
|
2024-02-28 21:07:14 +01:00
|
|
|
ynh_script_progression --message="Upgrading source files..."
|
2021-03-16 21:25:15 +01:00
|
|
|
|
2024-02-28 21:07:14 +01:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
|
|
|
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
|
2021-11-12 13:03:18 +01:00
|
|
|
|
2024-02-28 21:07:14 +01:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2021-11-12 13:03:18 +01:00
|
|
|
|
2020-06-03 23:41:51 +02:00
|
|
|
#=================================================
|
2024-02-28 21:07:14 +01:00
|
|
|
# UPDATE A CONFIG FILE
|
2020-06-03 23:41:51 +02:00
|
|
|
#=================================================
|
2024-02-28 21:07:14 +01:00
|
|
|
ynh_script_progression --message="Updating $app's configuration files..." --weight=1
|
2020-06-03 23:41:51 +02:00
|
|
|
|
2024-02-28 21:07:14 +01:00
|
|
|
if ynh_permission_has_user --permission=main --user=visitors; then
|
|
|
|
ynh_replace_string --match_string='"readonly": false,' --replace_string='"readonly": true,' --target_file="$install_dir/config.js"
|
2019-07-30 23:07:10 +02:00
|
|
|
fi
|
|
|
|
|
2020-06-03 23:41:51 +02:00
|
|
|
#=================================================
|
2024-02-28 21:07:14 +01:00
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
2020-06-03 23:41:51 +02:00
|
|
|
#=================================================
|
2024-02-28 21:07:14 +01:00
|
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
2016-06-13 22:03:33 +02:00
|
|
|
|
2022-07-29 02:04:07 +02:00
|
|
|
# Create a dedicated NGINX config
|
2020-06-03 23:57:07 +02:00
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2020-06-03 23:41:51 +02:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-06-15 01:58:37 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed"
|