diff --git a/scripts/backup b/scripts/backup index d621689..610ad7e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -28,10 +28,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) datadir=$(ynh_app_setting_get --app=$app --key=datadir) -# other variables -media_dir="/home/yunohost.multimedia/share/Music" -cmd_file="/usr/local/bin/mopidyctl" - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -47,7 +43,7 @@ ynh_backup --src_path="$final_path" # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$datadir" +ynh_backup --src_path="$datadir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION @@ -67,7 +63,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" # BACKUP VARIOUS FILES #================================================= -ynh_backup --src_path="$cmd_file" +ynh_backup --src_path="/usr/local/bin/mopidyctl" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 350ec9a..a543c58 100755 --- a/scripts/install +++ b/scripts/install @@ -61,15 +61,15 @@ port=$(ynh_find_port --port=6680) ynh_app_setting_set --app=$app --key=port --value=$port if [ $mpd_port -eq 1 ]; then - mpd_port=$(ynh_find_port --port=6600) + mpd_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 mpd_state="false" fi -ynh_app_setting_set --app=$app --key=mpd_port --value=$mpd_port - #================================================= # INSTALL DEPENDENCIES #================================================= @@ -109,9 +109,11 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP #================================================= -# ... +# BUILD MULTIMEDIA #================================================= +ynh_script_progression --message="Building multimedia directory..." +media_dir="/home/yunohost.multimedia/share/Music" ynh_multimedia_build_main_dir # /home/yunohost.multimedia #================================================= diff --git a/scripts/restore b/scripts/restore index bc6e61e..455ad05 100755 --- a/scripts/restore +++ b/scripts/restore @@ -29,10 +29,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) mpd_port=$(ynh_app_setting_get --app=$app --key=mpd_port) -# other variables -media_dir="/home/yunohost.multimedia/share/Music" -cmd_file="/usr/local/bin/mopidyctl" - #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= @@ -106,7 +102,7 @@ fi #================================================= ynh_script_progression --message="Restoring various files..." -ynh_restore_file --origin_path="$cmd_file" # /usr/local/bin/mopidyctl +ynh_restore_file --origin_path="/usr/local/bin/mopidyctl" # /usr/local/bin/mopidyctl #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 4dc486a..bb00cdb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,6 +118,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." +media_dir="/home/yunohost.multimedia/share/Music" ynh_add_config --template="../conf/app.conf" --destination="$final_path/$app.conf" chmod 400 "$final_path/some_config_file"