1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mopidy_ynh.git synced 2024-09-03 19:46:21 +02:00
This commit is contained in:
yalh76 2022-06-20 00:20:12 +02:00
parent 09bd911d67
commit 4285d593cd
6 changed files with 11 additions and 14 deletions

View file

@ -72,7 +72,7 @@ fi
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
ynh_systemd_action --service_name=$app --action="stop"
#=================================================
# MODIFY URL IN NGINX CONF

View file

@ -61,9 +61,8 @@ port=$(ynh_find_port --port=6680)
ynh_app_setting_set --app=$app --key=port --value=$port
if [ $mpd_port -eq 1 ]; then
mpd_port=6600
mpd_port=$(ynh_find_port --port=6600)
ynh_app_setting_set --app=$app --key=mpd_port --value=$mpd_port
ynh_port_available --port=$mpd_port || ynh_die --message="Port $mpd_port is needs to be available for this app"
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $mpd_port
mpd_state="true"
else
@ -194,9 +193,9 @@ ynh_script_progression --message="Scan local media directory..."
ynh_script_progression --message="Integrating service in YunoHost..."
if [ $mpd_port -ne 0 ]; then
yunohost service add $app --description="Mopidy music server" --log="/var/log/$app/$app.log" --needs_exposed_ports=$mpd_port
yunohost service add $app --description="Mopidy music server" --needs_exposed_ports=$mpd_port
else
yunohost service add $app --description="Mopidy music server" --log="/var/log/$app/$app.log"
yunohost service add $app --description="Mopidy music server"
fi
#=================================================

View file

@ -21,9 +21,6 @@ port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
mpd_port=$(ynh_app_setting_get --app=$app --key=mpd_port)
# other variables
cmd_file="/usr/local/bin/mopidyctl"
#=================================================
# STANDARD REMOVE
#=================================================
@ -78,6 +75,7 @@ then
ynh_script_progression --message="Closing port $mpd_port..." --weight=1
ynh_exec_warn_less yunohost firewall disallow TCP $mpd_port
fi
#=================================================
# SPECIFIC REMOVE
#=================================================
@ -85,7 +83,7 @@ fi
#=================================================
ynh_script_progression --message="Removing various files..."
ynh_secure_remove --file="$cmd_file"
ynh_secure_remove --file="/usr/local/bin/mopidyctl"
#=================================================
# GENERIC FINALIZATION

View file

@ -118,9 +118,9 @@ systemctl enable $app.service --quiet
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
if [ $mpd_port -ne 0 ]; then
yunohost service add $app --description="Mopidy music server" --log="/var/log/$app/$app.log" --needs_exposed_ports=$mpd_port
yunohost service add $app --description="Mopidy music server" --needs_exposed_ports=$mpd_port
else
yunohost service add $app --description="Mopidy music server" --log="/var/log/$app/$app.log"
yunohost service add $app --description="Mopidy music server"
fi
#=================================================

View file

@ -149,9 +149,9 @@ ynh_add_systemd_config
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
if [ $mpd_port -ne 0 ]; then
yunohost service add $app --description="Mopidy music server" --log="/var/log/$app/$app.log" --needs_exposed_ports=$mpd_port
yunohost service add $app --description="Mopidy music server" --needs_exposed_ports=$mpd_port
else
yunohost service add $app --description="Mopidy music server" --log="/var/log/$app/$app.log"
yunohost service add $app --description="Mopidy music server"
fi
#=================================================

View file

@ -3,7 +3,7 @@
SELF=$(basename $0)
DAEMON="__FINAL_PATH__/env/bin/mopidy"
DAEMON_USER="__APP__"
CONFIG_FILES="__CONF_FILE__"
CONFIG_FILES="__FINAL_PATH__/__APP__.conf"
CMD="$DAEMON --config $CONFIG_FILES $@"
if [ $# -eq 0 ]; then