diff --git a/scripts/change_url b/scripts/change_url index 702a5d2..4cf96d3 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -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 diff --git a/scripts/install b/scripts/install index a543c58..0d6c64b 100755 --- a/scripts/install +++ b/scripts/install @@ -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 #================================================= diff --git a/scripts/remove b/scripts/remove index ef25839..d78bc55 100755 --- a/scripts/remove +++ b/scripts/remove @@ -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 diff --git a/scripts/restore b/scripts/restore index 455ad05..d7f6f4e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bb00cdb..cab5c5c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #================================================= diff --git a/sources/extra_files/mopidyctl b/sources/extra_files/mopidyctl index 6d8210b..debe6e0 100644 --- a/sources/extra_files/mopidyctl +++ b/sources/extra_files/mopidyctl @@ -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