diff --git a/scripts/install b/scripts/install index c21e57a..0f2c388 100755 --- a/scripts/install +++ b/scripts/install @@ -187,7 +187,7 @@ ynh_use_logrotate # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add $app --description="Voxel game engine and game" --log="/var/log/$app/minetest.log" --needs_exposed_ports="$port" +yunohost service add $app --description="Voxel game engine and game" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port" #================================================= # RELOAD MINETEST diff --git a/scripts/upgrade b/scripts/upgrade index 27952e8..61d0887 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -27,11 +27,10 @@ creative=$(ynh_app_setting_get --app=$app --key=creative) damage=$(ynh_app_setting_get --app=$app --key=damage) servername=$(ynh_app_setting_get --app=$app --key=servername) - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_print_info --message="Checking version..." +ynh_script_progression --message="Checking version..." version=ynh_app_upstream_version if [ "$version" = "0.01" ]; then @@ -39,7 +38,7 @@ ynh_die --message="You can't upgrade to this version with simple upgrade. Please fi -ynh_print_info --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then @@ -59,7 +58,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -77,7 +76,7 @@ ynh_abort_if_errors #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info --message="Upgrading source files..." +ynh_script_progression --message="Upgrading source files..." # Remove old install ynh_secure_remove --file="$final_path" @@ -88,14 +87,14 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_print_info --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir=$home_path --use_shell @@ -103,7 +102,7 @@ ynh_system_user_create --username=$app --home_dir=$home_path --use_shell #================================================= # SETUP SYSTEMD #================================================= -ynh_print_info --message="Upgrading systemd configuration..." +ynh_script_progression --message="Upgrading systemd configuration..." # Create a dedicated systemd config ynh_add_systemd_config @@ -152,9 +151,6 @@ ynh_backup_if_checksum_is_different --file="$home_path/.minetest/minetest.conf" cp ../conf/minetest.conf $home_path/.minetest/minetest.conf -### `ynh_replace_string` is used to replace a string in a file. -### (It's compatible with sed regular expressions syntax) - ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf" @@ -170,7 +166,7 @@ ynh_store_file_checksum --file="$home_path/.minetest/minetest.conf" #================================================= # SETUP LOGROTATE #================================================= -ynh_print_info --message="Upgrading logrotate configuration..." +ynh_script_progression --message="Upgrading logrotate configuration..." # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append @@ -194,7 +190,7 @@ yunohost service add $app --description="Voxel game engine and game" --log="/var #================================================= # RELOAD MINETEST #================================================= -ynh_print_info --message="Restarting Minetest..." +ynh_script_progression --message="Restarting Minetest..." ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/minetest.log" --line_match="listening on" @@ -202,4 +198,4 @@ ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$ # END OF SCRIPT #================================================= -ynh_print_info --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed"