2022-01-10 15:18:34 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Setting up source files..."
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2023-03-16 20:20:21 +01:00
|
|
|
ynh_setup_source --dest_dir="$install_dir"
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2023-02-20 16:20:49 +01:00
|
|
|
chmod +x "$install_dir/shiori"
|
|
|
|
|
2022-01-10 15:18:34 +01:00
|
|
|
#=================================================
|
2023-02-20 16:31:16 +01:00
|
|
|
# SYSTEM CONFIGURATION
|
2022-01-10 15:18:34 +01:00
|
|
|
#=================================================
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Adding system configurations related to $app ..."
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_config_add_nginx
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_config_add_systemd
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_config_add_logrotate
|
2022-01-10 15:18:34 +01:00
|
|
|
|
2022-01-10 21:15:49 +01:00
|
|
|
# Create log directory
|
|
|
|
mkdir -p /var/log/$app
|
|
|
|
touch /var/log/$app/$app.log
|
|
|
|
|
2022-01-10 15:32:00 +01:00
|
|
|
yunohost service add $app --description="Simple bookmark manager" --log="/var/log/$app/$app.log"
|
2022-01-10 15:18:34 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Starting $app's systemd service..."
|
2022-01-10 15:18:34 +01:00
|
|
|
|
|
|
|
# Start a systemd service
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_systemctl --service=$app --action="start" --log_path="systemd"
|
2022-01-10 15:18:34 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2024-08-31 03:00:17 +02:00
|
|
|
ynh_script_progression "Installation of $app completed"
|