#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers #================================================= # SYSTEM CONFIGURATION #================================================= ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1 # Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config yunohost service add $app --description="qBittorrent-nox service" --log="$install_dir/.local/share/data/qBittorrent/logs/qbittorrent.log" # Use logrotate to manage application logfile(s) ynh_use_logrotate mkdir -p "$install_dir/.config/qBittorrent/" ynh_add_config --template="../conf/qBittorrent.conf" --destination="$install_dir/.config/qBittorrent/qBittorrent.conf" chown $app: -R "$install_dir/.config/" chmod 600 "$install_dir/.config/qBittorrent/qBittorrent.conf" #================================================= # YUNOHOST MULTIMEDIA INTEGRATION #================================================= ynh_script_progression --message="Adding multimedia directories..." --weight=6 # Build YunoHost multimedia directories ynh_multimedia_build_main_dir ynh_multimedia_addfolder --source_dir="$data_dir" --dest_dir="share/Torrents" #================================================= # GENERIC FINALIZATION #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action=start --line_match="Web UI: Now listening on IP: \*, port: $port" --log_path="$install_dir/.local/share/data/qBittorrent/logs/qbittorrent.log" --timeout=3600 #================================================= # END OF SCRIPT #================================================= ynh_script_progression --message="Installation of $app completed" --last