mirror of
https://github.com/YunoHost-Apps/opentracker_ynh.git
synced 2024-09-03 19:46:34 +02:00
50 lines
1.6 KiB
Bash
50 lines
1.6 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
|
|
cp ../conf/Makefile $install_dir/Makefile
|
|
cp ../conf/opentracker.conf.sample $install_dir/opentracker.conf
|
|
pushd $install_dir
|
|
ynh_exec_warn_less make
|
|
popd
|
|
|
|
#=================================================
|
|
# SETUP SYSTEMD
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
|
|
|
# Create a dedicated systemd config
|
|
ynh_add_systemd_config
|
|
|
|
# Set permissions to app files
|
|
chown -R $app: $install_dir
|
|
chmod +x $install_dir/$app
|
|
|
|
#=================================================
|
|
# 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
|