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
|
|
|
#=================================================
|
2024-03-01 09:28:35 +01:00
|
|
|
# SYSTEM CONFIGURATION
|
2021-02-28 08:43:32 +01:00
|
|
|
#=================================================
|
2024-03-01 09:28:35 +01:00
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
2021-02-28 08:43:32 +01:00
|
|
|
|
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
# Create a dedicated systemd config
|
|
|
|
ynh_add_systemd_config
|
|
|
|
|
|
|
|
# Use logrotate to manage application logfile(s)
|
|
|
|
ynh_use_logrotate
|
|
|
|
|
2024-02-13 02:27:16 +01:00
|
|
|
mkdir -p "/var/log/$app"
|
|
|
|
chmod 640 "/var/log/$app"
|
|
|
|
|
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
|