2015-05-24 23:01:16 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
|
#=================================================
|
|
|
|
|
# GENERIC START
|
|
|
|
|
#=================================================
|
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
2022-03-12 16:55:59 +01:00
|
|
|
|
#=================================================
|
|
|
|
|
# SPECIFIC SETUP
|
2021-11-25 19:38:26 +01:00
|
|
|
|
#=================================================
|
|
|
|
|
# INSTALL DUNITER
|
|
|
|
|
#=================================================
|
2022-05-02 19:22:58 +02:00
|
|
|
|
ynh_script_progression --message="Installation of Debian package of Duniter…"
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
2024-02-21 15:09:21 +01:00
|
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2024-02-21 14:59:14 +01:00
|
|
|
|
ynh_exec_warn_less dpkg -i "$install_dir/duniter-server.deb"
|
|
|
|
|
ynh_secure_remove "$install_dir/duniter-server.deb"
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
2022-03-12 16:55:59 +01:00
|
|
|
|
#=================================================
|
|
|
|
|
# CREATE DATA DIRECTORY
|
|
|
|
|
#=================================================
|
2024-02-21 14:59:14 +01:00
|
|
|
|
ynh_script_progression --message="Configuring a data directory…"
|
2022-03-12 16:55:59 +01:00
|
|
|
|
|
2024-02-21 14:59:14 +01:00
|
|
|
|
chmod -R o-rwx "$data_dir"
|
|
|
|
|
chown -R $app:www-data "$data_dir"
|
2022-03-12 16:55:59 +01:00
|
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
|
#=================================================
|
2022-05-05 20:35:42 +02:00
|
|
|
|
# CONFIGURE DUNITER
|
2021-11-25 19:38:26 +01:00
|
|
|
|
#=================================================
|
2022-05-05 20:35:42 +02:00
|
|
|
|
ynh_script_progression --message="Configure Duniter…"
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
2022-05-05 20:35:42 +02:00
|
|
|
|
CONFIGURE_DUNITER
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
|
|
|
|
#=================================================
|
2024-02-21 14:59:14 +01:00
|
|
|
|
# SYSTEM CONFIGURATION
|
2021-11-25 19:38:26 +01:00
|
|
|
|
#=================================================
|
2024-02-21 14:59:14 +01:00
|
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
|
|
|
|
|
|
|
|
|
# Create a dedicated NGINX config
|
|
|
|
|
ynh_add_nginx_config
|
2016-06-23 12:05:02 +02:00
|
|
|
|
|
2022-03-12 16:55:59 +01:00
|
|
|
|
# Create a dedicated systemd config
|
2021-11-25 19:38:26 +01:00
|
|
|
|
ynh_add_systemd_config
|
2024-02-21 14:59:14 +01:00
|
|
|
|
yunohost service add "$app"
|
2017-02-14 11:22:33 +01:00
|
|
|
|
|
2021-11-25 19:38:26 +01:00
|
|
|
|
#=================================================
|
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
|
#=================================================
|
2022-05-02 19:22:58 +02:00
|
|
|
|
ynh_script_progression --message="Starting a systemd service…"
|
2021-11-25 19:38:26 +01:00
|
|
|
|
|
|
|
|
|
# Start a systemd service
|
2024-02-23 16:32:45 +01:00
|
|
|
|
ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Web administration accessible"
|
2020-06-11 18:27:42 +02:00
|
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
|
# END OF SCRIPT
|
|
|
|
|
#=================================================
|
2022-03-12 16:55:59 +01:00
|
|
|
|
|
|
|
|
|
ynh_script_progression --message="Installation of $app completed"
|