From 8f9aea80fb6192f8f6928c4b7ec290584a58e3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 26 Apr 2024 22:03:05 +0200 Subject: [PATCH] Use = intead of space for helper args to avoid issue with parameter --- scripts/change_url | 2 +- scripts/install | 6 +++--- scripts/remove | 2 +- scripts/restore | 4 ++-- scripts/upgrade | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c46db0e..3940ef6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -41,7 +41,7 @@ set_permission ynh_script_progression --message="Starting a systemd service..." --weight=3 # Start a systemd service -ynh_systemd_action --service_name="$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 5827001..748f600 100644 --- a/scripts/install +++ b/scripts/install @@ -13,9 +13,9 @@ source /usr/share/yunohost/helpers #================================================= # Postgresql superuser #================================================= -ynh_script_progression --message="Configuring Postgresql superuser..." --weight 1 +ynh_script_progression --message="Configuring Postgresql superuser..." --weight=1 -ynh_psql_execute_as_root --sql "ALTER USER $db_user WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" +ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" ynh_script_progression --message='Creating base directory...' @@ -69,7 +69,7 @@ set_permission #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name "$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 8d8c063..92c4162 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Stop service -ynh_systemd_action --service_name "$app.service" --action stop +ynh_systemd_action --service_name="$app.service" --action=stop ynh_remove_systemd_config --service=$app yunohost service remove $app diff --git a/scripts/restore b/scripts/restore index eb87410..627ef08 100644 --- a/scripts/restore +++ b/scripts/restore @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Restoring the Postgresql superuser..." --weight=1 -ynh_psql_execute_as_root --sql "ALTER USER $app WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" +ynh_psql_execute_as_root --sql="ALTER USER $app WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" #================================================= # RESTORE ALL CONFIG AND DATA @@ -50,7 +50,7 @@ set_permission #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name "$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index b47c095..417dfd4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,14 +18,14 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Stopping a systemd service..." --weight=1 if [ -f "/etc/uwsgi/apps-available/$app.ini" ]; then - ynh_systemd_action --service_name "uwsgi-app@$app.service" --action stop + ynh_systemd_action --service_name="uwsgi-app@$app.service" --action=stop systemctl disable "uwsgi-app@$app.service" --quiet yunohost service remove "uwsgi-app@$app" || true ynh_secure_remove --file="/etc/uwsgi/apps-available/$app.ini" ynh_secure_remove --file="/etc/systemd/system/uwsgi-app@$app.service.d" else - ynh_systemd_action --service_name "$app.service" --action stop + ynh_systemd_action --service_name="$app.service" --action=stop fi #================================================= @@ -59,7 +59,7 @@ fi ynh_script_progression --message="Configuring Postgresql superuser..." --weight=1 # Re-set the db_pwd just in caseā€¦ -ynh_psql_execute_as_root --sql "ALTER USER $app WITH PASSWORD '$db_pwd' SUPERUSER CREATEDB CREATEROLE REPLICATION" +ynh_psql_execute_as_root --sql="ALTER USER $app WITH PASSWORD '$db_pwd' SUPERUSER CREATEDB CREATEROLE REPLICATION" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -90,7 +90,7 @@ ynh_add_systemd_config --service=$app --template=pgadmin.service yunohost service add $app --log "/var/log/$app/$app.log" --description 'PgAdmin application' # Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --logfile /var/log/$app --nonappend +ynh_use_logrotate --logfile=/var/log/$app --nonappend set_permission @@ -99,7 +99,7 @@ set_permission #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name "$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd #================================================= # END OF SCRIPT