From 4648784dfcccd50aa28aaf768890770b8aca9ef2 Mon Sep 17 00:00:00 2001 From: Rafi594 Date: Thu, 24 Oct 2019 14:55:53 +0200 Subject: [PATCH] Fixed then in upgrade and ynh_systemd_action --- scripts/backup | 9 ++++++++- scripts/change_url | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 3 +-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/backup b/scripts/backup index 62d8e57..5508634 100755 --- a/scripts/backup +++ b/scripts/backup @@ -33,6 +33,13 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= # STANDARD BACKUP STEPS +#================================================= +# BACKUP THE APP MAIN DIR +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" + #================================================= # BACKUP THE APP MAIN DIR #================================================= @@ -70,6 +77,6 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" # END OF SCRIPT #================================================= # Restart Minetest -ynh_systemd_action --action=start --line_match="Server for gameid=\"$app\" listening on :::30000." --log_path="/var/log/$app/minetest.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index d1f8c37..e458bd3 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -60,7 +60,7 @@ ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" - #================================================= ynh_print_info --message="Reloading Minetest..." -ynh_systemd_action --action=restart --line_match="Server for gameid=\"$app\" listening on :::30000." --log_path="/var/log/$app/minetest.log" +ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 00c1a05..72d7dc1 100755 --- a/scripts/install +++ b/scripts/install @@ -268,7 +268,7 @@ yunohost service add $app --log "/var/log/$app/minetest.log" #================================================= ynh_print_info --message="Reloading minetest..." -ynh_systemd_action --action=restart --line_match="Server for gameid=\"$app\" listening on :::30000." --log_path="/var/log/$app/minetest.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 571b705..16332e8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -109,7 +109,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_print_info --message="Reloading minetest..." -ynh_systemd_action --action=restart --line_match="Server for gameid=\"$app\" listening on :::30000." --log_path="/var/log/$app/minetest.log" +ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index b5b9211..80e7fc9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,7 +34,6 @@ ynh_print_info --message="Checking version..." version=ynh_app_upstream_version if [ "$version" = "0.01" ]; then -then ynh_die --message="You can't upgrade to this version with simple upgrade. Please read the readme for upgrading https://github.com/YunoHost-Apps/minetest_ynh#additional-information ..." fi @@ -182,7 +181,7 @@ chown -R $app: $home_path #================================================= ynh_print_info --message="Restarting Minetest..." -ynh_systemd_action --action=restart --line_match="Server for gameid=\"$app\" listening on :::30000." --log_path="/var/log/$app/minetest.log" +ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT