diff --git a/scripts/install b/scripts/install index 21c6977..87dbb19 100755 --- a/scripts/install +++ b/scripts/install @@ -108,7 +108,7 @@ ynh_setup_source --dest_dir="$final_path" --source_id=$architecture chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -120,14 +120,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # ADD A CONFIGURATION #================================================= @@ -138,6 +130,14 @@ ynh_add_config --template="../conf/config.ini" --destination="$final_path/config chmod 400 "$final_path/config.ini" chown $app:$app "$final_path/config.ini" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # MAKE SETUP #================================================= diff --git a/scripts/restore b/scripts/restore index 086ae0e..c2dddff 100755 --- a/scripts/restore +++ b/scripts/restore @@ -69,7 +69,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index ae43814..a5b58c8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,7 +115,7 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -140,14 +140,6 @@ pushd $final_path sudo -u $app ./writefreely --migrate popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -158,6 +150,14 @@ ynh_add_config --template="../conf/config.ini" --destination="$final_path/config chmod 400 "$final_path/config.ini" chown $app:$app "$final_path/config.ini" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # GENERIC FINALIZATION #=================================================