From 1dad5ffde13bdb4544056e657fedabb6e7a76f05 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 19 Apr 2020 21:54:21 +0200 Subject: [PATCH] Add arguments --- scripts/install | 2 +- scripts/remove | 2 +- scripts/upgrade | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index 618c69a..63e226d 100644 --- a/scripts/install +++ b/scripts/install @@ -125,7 +125,7 @@ ynh_print_info --message="Configuring system user..." ynh_system_user_create --username=$app #================================================= -## Copy and fix variable into lstu config +# Copy and fix variable into lstu config #================================================= ynh_print_info --message="Configuring lstu..." diff --git a/scripts/remove b/scripts/remove index c5d7b72..e46d36b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -50,7 +50,7 @@ ynh_remove_systemd_config ynh_print_info --message="Removing the PostgreSQL database..." # Remove a database if it exists, along with the associated user -ynh_psql_remove_db --db_name=$db_name --db_user=$db_user +ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES diff --git a/scripts/upgrade b/scripts/upgrade index 6c109c5..2d389b6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,28 +56,28 @@ if [ -z "$final_path" ]; then fi if [ -z "$db_pwd" ]; then - db_pwd=$(ynh_app_setting_get $app db_pwd) # Fix old db_pwd + db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) # Fix old db_pwd if [ -z "$db_pwd" ]; then - db_name=$(ynh_sanitize_dbid "$app") + db_name=$(ynh_sanitize_dbid --db_name="$app") db_user=$db_name # Initialize database and store postgres password for upgrade - ynh_psql_setup_db "$db_name" "$db_user" - ynh_app_setting_set "$app" db_name "$db_name" - db_pwd=$(ynh_app_setting_get $app psqlpwd) # Password created in ynh_psql_setup_db function + ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" + ynh_app_setting_set --app="$app" --key=db_name --value="$db_name" + db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) # Password created in ynh_psql_setup_db function else - ynh_app_setting_delete $app db_pwd - ynh_app_setting_set $app psqlpwd $db_pwd + ynh_app_setting_delete --app=$app --key=db_pwd + ynh_app_setting_set --app=$app --key=psqlpwd --value=$db_pwd fi fi if [ -z "$theme" ]; then theme="milligram" - ynh_app_setting_set $app theme $theme + ynh_app_setting_set --app=$app --key=theme --value=$theme fi if [ -z "$hashed_password" ]; then # Generate random password - password=$(ynh_string_random 8) + password=$(ynh_string_random --length=8) hashed_password=$(echo -n $password | sha256sum | cut -d' ' -f1) echo "The new version of LSTU provide an admin and a stats area which required a password." > mail_to_send @@ -86,7 +86,7 @@ if [ -z "$hashed_password" ]; then ynh_send_readme_to_admin --app_message="mail_to_send" --type="upgrade" - ynh_app_setting_set $app hashed_password $hashed_password + ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password fi #================================================= @@ -233,7 +233,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action -n $app -a reload -l "Reloaded Shortened URLs service." -p "systemd" +ynh_systemd_action --service_name=$app --action=reload --line_match="Reloaded Shortened URLs service." --log_path="systemd" #================================================= # RELOAD NGINX