Reload variable before create user

This commit is contained in:
Josué Tille 2019-03-02 00:00:55 +01:00
parent e5906e7ab4
commit f1da593278
No known key found for this signature in database
GPG Key ID: D5E068C6DFA8681D

View File

@ -43,11 +43,6 @@ systemctl stop "$app".service
ynh_handle_app_migration gogs gogs_migrations ynh_handle_app_migration gogs gogs_migrations
if [[ $migration_process -eq 1 ]]; then if [[ $migration_process -eq 1 ]]; then
# Replace the user
ynh_system_user_delete $old_app
test getent passwd "$app" &>/dev/null || \
useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \
ynh_die "Unable to create $app system account"
# Reload variables # Reload variables
dbname=$app dbname=$app
@ -57,6 +52,12 @@ if [[ $migration_process -eq 1 ]]; then
REPO_PATH="$DATADIR/repositories" REPO_PATH="$DATADIR/repositories"
DATA_PATH="$DATADIR/data" DATA_PATH="$DATADIR/data"
# Replace the user
ynh_system_user_delete $old_app
test getent passwd "$app" &>/dev/null || \
useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \
ynh_die "Unable to create $app system account"
# Clean old binary # Clean old binary
ynh_secure_remove $final_path/gogs ynh_secure_remove $final_path/gogs
ynh_secure_remove $final_path/custom/conf/auth.d ynh_secure_remove $final_path/custom/conf/auth.d