mirror of
https://github.com/YunoHost-Apps/opentracker_ynh.git
synced 2024-09-03 19:46:34 +02:00
52 lines
1.7 KiB
Bash
52 lines
1.7 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
#=================================================
|
|
ynh_script_progression --message="Installing OpenTracker..." --weight=5
|
|
|
|
git clone git://erdgeist.org/opentracker "$install_dir" --quiet
|
|
|
|
ynh_add_config --template="Makefile" --destination="$install_dir/Makefile"
|
|
ynh_add_config --template="opentracker.conf.sample" --destination="$install_dir/opentracker.conf"
|
|
|
|
pushd $install_dir
|
|
ynh_exec_warn_less make
|
|
popd
|
|
|
|
# Set permissions to app files
|
|
chown -R $app: $install_dir
|
|
chmod +x $install_dir/$app
|
|
|
|
#=================================================
|
|
# SETUP SYSTEMD
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
|
|
|
# Create a dedicated systemd config
|
|
ynh_add_systemd_config
|
|
|
|
#=================================================
|
|
# INTEGRATE SERVICE IN YUNOHOST
|
|
#=================================================
|
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|
|
|
yunohost service add $app --description="Bittorrent tracker" --log="systemd" --needs_exposed_ports="$port"
|
|
|
|
# Start a systemd service
|
|
ynh_systemd_action --service_name=$app --action=start --log_path="systemd"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Installation of OpenTracker completed" --last
|