1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/komga_ynh.git synced 2024-09-03 19:36:07 +02:00
komga_ynh/scripts/install

66 lines
2.2 KiB
Text
Raw Normal View History

2021-02-28 08:43:32 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2021-02-28 18:39:07 +01:00
ynh_script_progression --message="Setting up source files..." --weight=15
2021-02-28 08:43:32 +01:00
2023-08-03 09:31:14 +02:00
ynh_setup_source --dest_dir="$install_dir"
2021-02-28 08:43:32 +01:00
2023-08-03 09:31:14 +02:00
chown -R $app:www-data "$install_dir"
chmod +x $install_dir/komga.jar
2021-07-08 18:57:02 +02:00
2021-02-28 08:43:32 +01:00
#=================================================
# NGINX CONFIGURATION
#=================================================
2021-02-28 18:39:07 +01:00
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
2021-02-28 08:43:32 +01:00
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SETUP SYSTEMD
#=================================================
2021-02-28 18:39:07 +01:00
ynh_script_progression --message="Configuring a systemd service..." --weight=1
2021-02-28 08:43:32 +01:00
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# SETUP LOGROTATE
#=================================================
2021-02-28 18:39:07 +01:00
ynh_script_progression --message="Configuring log rotation..." --weight=1
2021-02-28 08:43:32 +01:00
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
2021-02-28 18:39:07 +01:00
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
2021-02-28 08:43:32 +01:00
2021-03-01 10:03:40 +01:00
yunohost service add $app --description="Media server for your comics, manga and magazines" --log="/var/log/$app/$app.log"
2021-02-28 08:43:32 +01:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
2021-02-28 18:39:07 +01:00
ynh_script_progression --message="Starting a systemd service..." --weight=1
2021-02-28 08:43:32 +01:00
# Start a systemd service
2021-07-09 07:03:46 +02:00
ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="Started ApplicationKt"
2021-02-28 08:43:32 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2021-02-28 18:39:07 +01:00
ynh_script_progression --message="Installation of $app completed" --last