mirror of
https://github.com/YunoHost-Apps/lstu_ynh.git
synced 2024-09-03 19:36:12 +02:00
Add arguments
This commit is contained in:
parent
f023dda275
commit
1dad5ffde1
3 changed files with 13 additions and 13 deletions
|
@ -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..."
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue