1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/duniter_ynh.git synced 2024-09-03 18:26:35 +02:00
duniter_ynh/scripts/install

62 lines
2 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# SPECIFIC SETUP
#=================================================
# INSTALL DUNITER
#=================================================
ynh_script_progression --message="Installation of Debian package of Duniter…"
ynh_setup_source --dest_dir="$install_dir"
ynh_exec_warn_less dpkg -i "$install_dir/duniter-server.deb"
ynh_secure_remove "$install_dir/duniter-server.deb"
#=================================================
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Configuring a data directory…"
chmod -R o-rwx "$data_dir"
chown -R $app:www-data "$data_dir"
#=================================================
# CONFIGURE DUNITER
#=================================================
ynh_script_progression --message="Configure Duniter…"
CONFIGURE_DUNITER
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add "$app"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service…"
# Start a systemd service
ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="Web administration accessible"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed"