From a6f6cc142ee5dbb0157c5b7d12edaa45c8ba7230 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 20:06:32 +0200 Subject: [PATCH] adding additional ynh_script_progression --- scripts/backup | 1 + scripts/install | 4 ++++ scripts/restore | 6 ++++++ scripts/upgrade | 2 ++ 4 files changed, 13 insertions(+) diff --git a/scripts/backup b/scripts/backup index d985aba..0988231 100755 --- a/scripts/backup +++ b/scripts/backup @@ -96,6 +96,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= # BACKUP A CRON FILE #================================================= +ynh_script_progression --message="Backing up cron file..." --time --weight=1 ynh_backup --src_path="/etc/cron.d/$app" diff --git a/scripts/install b/scripts/install index 631b05a..1662502 100755 --- a/scripts/install +++ b/scripts/install @@ -235,6 +235,7 @@ fi #================================================= # MODIFY A CONFIG FILE #================================================= +ynh_script_progression --message="Modifying a config file..." --time --weight=1 ### `ynh_replace_string` is used to replace a string in a file. ### (It's compatible with sed regular expressions syntax) @@ -244,6 +245,7 @@ ynh_replace_string --match_string="match_string" --replace_string="replace_strin #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= +ynh_script_progression --message="Storing the config file checksum..." --time --weight=1 ### `ynh_store_file_checksum` is used to store the checksum of a file. ### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`, @@ -257,6 +259,7 @@ ynh_store_file_checksum --file="$final_path/CONFIG_FILE" #================================================= # SECURE FILES AND DIRECTORIES #================================================= +ynh_script_progression --message="Securing files and directories..." --time --weight=1 ### For security reason, any app should set the permissions to root: before anything else. ### Then, if write authorization is needed, any access should be given only to directories @@ -284,6 +287,7 @@ ynh_use_logrotate #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #================================================= +ynh_script_progression --message="Advertising service in admin panel..." --time --weight=1 ### `yunohost service add` is a CLI yunohost command to add a service in the admin panel. ### You'll find the service in the 'services' section of YunoHost admin panel. diff --git a/scripts/restore b/scripts/restore index dd27696..807199a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -48,6 +48,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the nginx web server configuration..." --time --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -69,6 +70,7 @@ ynh_system_user_create --username=$app #================================================= # RESTORE USER RIGHTS #================================================= +ynh_script_progression --message="Restoring system user..." --time --weight=1 # Restore permissions on app files chown -R root: $final_path @@ -76,6 +78,7 @@ chown -R root: $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Restoring php-fpm..." --time --weight=1 ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" @@ -118,6 +121,7 @@ systemctl enable $app.service #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #================================================= +ynh_script_progression --message="Advertising service in admin panel..." --time --weight=1 yunohost service add $app --log "/var/log/$app/$app.log" @@ -131,12 +135,14 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RESTORE THE CRON FILE #================================================= +ynh_script_progression --message="Restoring the cron file..." --time --weight=1 ynh_restore_file --origin_path="/etc/cron.d/$app" #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --time --weight=1 ynh_restore_file --origin_path="/etc/logrotate.d/$app" diff --git a/scripts/upgrade b/scripts/upgrade index 243e85b..e9b9ff3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,6 +149,7 @@ ynh_add_fpm_config #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= +ynh_script_progression --message="Storing the config file checksum..." --time --weight=1 ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. ### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. @@ -185,6 +186,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg #================================================= # SECURE FILES AND DIRECTORIES #================================================= +ynh_script_progression --message="Securing files and directories..." --time --weight=1 # Set permissions on app files chown -R root: $final_path