2021-03-01 02:41:36 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD UPGRADE STEPS
|
|
|
|
#=================================================
|
|
|
|
# STOP SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2021-07-14 18:44:40 +02:00
|
|
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
2021-03-01 02:41:36 +01:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-02-04 19:14:24 +01:00
|
|
|
ynh_script_progression --message="Upgrading source files..." --weight=1
|
2021-03-01 02:41:36 +01:00
|
|
|
|
2024-02-04 19:14:24 +01:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2024-02-04 20:34:16 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir/source" --full_replace=1 --keep="accounts/newsmirror"
|
2021-03-01 02:41:36 +01:00
|
|
|
|
2024-02-04 19:14:24 +01:00
|
|
|
chmod 750 "$install_dir"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2021-03-01 02:41:36 +01:00
|
|
|
|
|
|
|
#=================================================
|
2024-02-04 19:14:24 +01:00
|
|
|
# REAPPLY SYSTEM CONFIGURATIONS
|
2021-03-01 02:41:36 +01:00
|
|
|
#=================================================
|
2024-02-04 19:14:24 +01:00
|
|
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
2021-03-01 02:41:36 +01:00
|
|
|
|
2022-08-02 04:04:50 +02:00
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
2021-03-01 02:41:36 +01:00
|
|
|
|
|
|
|
# Create a dedicated systemd config
|
2021-07-14 18:44:40 +02:00
|
|
|
ynh_add_systemd_config
|
2024-02-04 19:14:24 +01:00
|
|
|
yunohost service add "$app" --description="Federated social network server" --log="/var/log/$app/$app.log"
|
2021-03-01 02:41:36 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
2024-02-04 19:14:24 +01:00
|
|
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
2021-03-01 02:41:36 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2021-07-14 18:44:40 +02:00
|
|
|
ynh_script_progression --message="Upgrade of $app completed" --last
|