mirror of
https://github.com/YunoHost-Apps/duniter_ynh.git
synced 2024-09-03 18:26:35 +02:00
62 lines
2 KiB
Bash
62 lines
2 KiB
Bash
#!/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" --source_id=$architecture
|
||
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
|
||
|
||
#=================================================
|
||
# END OF SCRIPT
|
||
#=================================================
|
||
|
||
ynh_script_progression --message="Installation of $app completed"
|