From 63e0f537ff10f220978f089898825edf72cdbc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 13 Dec 2023 01:16:06 +0100 Subject: [PATCH] Add warning if service is running while doing the backup --- scripts/backup | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/backup b/scripts/backup index 6997b0f..ba41220 100755 --- a/scripts/backup +++ b/scripts/backup @@ -15,6 +15,10 @@ source /usr/share/yunohost/helpers #================================================= ynh_print_info --message="Declaring files to be backed up..." +if [[ ! "$(systemctl status $app)" =~ "Active: inactive (dead)" ]]; then + ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'" +fi + #================================================= # BACKUP THE APP MAIN DIR #=================================================