From 2a2dd0c01065c1a6c125bbcff4770b3b287e255d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 26 Apr 2024 21:41:46 +0200 Subject: [PATCH] Use = intead of space for helper args to avoid issue with parameter --- scripts/_common.sh | 2 +- scripts/backup | 8 ++++---- scripts/change_url | 2 +- scripts/install | 6 +++--- scripts/restore | 4 ++-- scripts/upgrade | 6 +++--- sources/update_config_if_needed.sh | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index fcf8c2e..5181e64 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -145,7 +145,7 @@ EOF # Used by update_config_if_needed.sh hook save_vars_current_value() { for var in $var_list_to_manage; do - ynh_app_setting_set --app "$app" --key previous_$var --value "${!var}" + ynh_app_setting_set --app="$app" --key=previous_$var --value="${!var}" done } diff --git a/scripts/backup b/scripts/backup index ce158a9..02e89fd 100755 --- a/scripts/backup +++ b/scripts/backup @@ -29,11 +29,11 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= ynh_backup --src_path="/etc/$app/" -ynh_backup --src_path "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_backup --src_path "$nginx_status_conf" +ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup --src_path="$nginx_status_conf" ynh_print_info --message="Backing up code..." -ynh_backup --src_path $install_dir +ynh_backup --src_path=$install_dir #================================================= # SPECIFIC BACKUP @@ -41,7 +41,7 @@ ynh_backup --src_path $install_dir # BACKUP SYSTEMD #================================================= -ynh_backup --src_path "/etc/systemd/system/$app.service" +ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= # BACKUP VARIOUS FILES diff --git a/scripts/change_url b/scripts/change_url index 1775302..8e33286 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -39,7 +39,7 @@ ynh_add_jinja_config --template=monitorix.conf --destination=/etc/monitorix/moni # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action=start --log_path 'systemd' --line_match ' - Ok, ready.' +ynh_systemd_action --service_name="$app" --action=start --log_path='systemd' --line_match=' - Ok, ready.' #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index b7eb8a4..c01f6d4 100755 --- a/scripts/install +++ b/scripts/install @@ -44,7 +44,7 @@ mv /var/log/new_"${app}" /var/log/"${app}" ynh_script_progression --message="Adding configurations related to $app..." --weight=1 ynh_add_jinja_config --template=monitorix.conf --destination="/etc/monitorix/monitorix.conf" -ynh_add_jinja_config --template=nginx_status.conf --destination "$nginx_status_conf" +ynh_add_jinja_config --template=nginx_status.conf --destination="$nginx_status_conf" ynh_add_nginx_config ynh_add_systemd_config @@ -69,14 +69,14 @@ ynh_script_progression --message="Protecting directory..." set_permission -ynh_use_logrotate --logfile "/var/log/$app" +ynh_use_logrotate --logfile="/var/log/$app" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action="start" --log_path 'systemd' --line_match ' - Ok, ready.' +ynh_systemd_action --service_name="$app" --action="start" --log_path='systemd' --line_match=' - Ok, ready.' # when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded ynh_systemd_action --service_name=nginx.service --action=restart save_vars_current_value diff --git a/scripts/restore b/scripts/restore index 23e5795..a5e62fd 100755 --- a/scripts/restore +++ b/scripts/restore @@ -49,7 +49,7 @@ ynh_script_progression --message="Protecting directory..." set_permission -ynh_use_logrotate --logfile "/var/log/$app" +ynh_use_logrotate --logfile="/var/log/$app" #================================================= # GENERIC FINALIZATION @@ -58,7 +58,7 @@ ynh_use_logrotate --logfile "/var/log/$app" #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name="$app" --action=start --log_path 'systemd' --line_match ' - Ok, ready.' +ynh_systemd_action --service_name="$app" --action=start --log_path='systemd' --line_match=' - Ok, ready.' # when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded ynh_systemd_action --service_name=nginx.service --action=restart ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 164baa1..e051fa3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,7 +77,7 @@ fi ynh_script_progression --message="Upgrading configurations related to $app..." --weight=1 ynh_add_jinja_config --template=monitorix.conf --destination=/etc/monitorix/monitorix.conf -ynh_add_jinja_config --template=nginx_status.conf --destination "$nginx_status_conf" +ynh_add_jinja_config --template=nginx_status.conf --destination="$nginx_status_conf" if "$phpfpm_installed"; then config_php_fpm fi @@ -104,14 +104,14 @@ ynh_script_progression --message="Protecting directory..." set_permission -ynh_use_logrotate --logfile "/var/log/$app" +ynh_use_logrotate --logfile="/var/log/$app" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app" --action=restart --log_path=systemd --line_match ' - Ok, ready.' +ynh_systemd_action --service_name="$app" --action=restart --log_path=systemd --line_match=' - Ok, ready.' # when we change the value of 'listen [::1]:xxx;' nginx don't reload correctly the config, so force to restart to ensure that the new config are loaded ynh_systemd_action --service_name=nginx.service --action=restart save_vars_current_value diff --git a/sources/update_config_if_needed.sh b/sources/update_config_if_needed.sh index 8429664..a4846d3 100644 --- a/sources/update_config_if_needed.sh +++ b/sources/update_config_if_needed.sh @@ -76,13 +76,13 @@ if "$status_dirty"; then emailreports_yearly_to="$(ynh_app_setting_get --app="$app" --key=emailreports_yearly_to)" ynh_add_jinja_config --template=monitorix.conf --destination="/etc/monitorix/monitorix.conf" - ynh_add_jinja_config --template=nginx_status.conf --destination "$nginx_status_conf" + ynh_add_jinja_config --template=nginx_status.conf --destination="$nginx_status_conf" configure_db if "$phpfpm_installed"; then config_php_fpm fi - ynh_systemd_action --service_name="$app" --action=restart --log_path 'systemd' --line_match ' - Ok, ready.' + ynh_systemd_action --service_name="$app" --action=restart --log_path='systemd' --line_match=' - Ok, ready.' ynh_systemd_action --service_name=nginx --action=reload save_vars_current_value fi